mihai9323 / Jocoi

0 stars 0 forks source link

MoveToPosition #7

Closed mihai9323 closed 9 years ago

mihai9323 commented 9 years ago

This class translates any object it is assigned to when the function StartMoving is called

The object will start moving when the StartMoving function is called. The parameters of this function are the destination of the movement, the function that will be called when the movement completed, a sound to be played with the movement and the boolean value of the animator property that needs to be changed to true on the animator object that moves so that an animation is played. When the movement is completed the AtDestination is called to reset the sound and the animation. The move coroutine will actually move the object in time. The StopMovement() can be called from outside the class to abruptly stop the object from moving. This handles what needs to be done when this occurs