Animation State

    Animation states are represented by class .

    An animation state traces the accumulated playback time of an animation. The initial accumulated playback time is 0 and it’s self accumulated while playing automatically. In the case of a looping playback, the accumulated playback time would be duration * 2 when the second pass done.

    At arbitrary time, the playback location of the animation is called as progress time. Obviously process time is always in the range [0, duration].

    The accumulated playback time and progress time can be accessed through time and current fields, whereas accumulated playback time can be manually set but progress time is read only.

    The animation can be stopped once it had been played to the end or can be loop forever, or, can be played to the end and replay to the begin so forth. These are called loop modes, denoted by enumeration :

    Besides, each loop mode in above table have a reversing edition:

    The initial loop mode is read from the animation clip. Assign to wrapMode would alter the loop mode.

    NOTE: you should set loop count after you set loop mode since the loop count is reset after you set loop mode. and its responding AnimationClip.WrapMode.Reverse would reset the loop count as 1. The others reset the loop count as Infinity(infinite count).

    Animation state provides the following methods to control the playing, pausing, resuming and stopping of a animation:

    The following fields can be used to query the playback status:

    The playback status and playback control is formatted as the following graph: