Exemple #1
0
 /// <summary>
 /// Should be called from the owning modules' Update() method, and should be called/updated per-frame.
 /// (TODO -- investigate if this can be moved to FixedUpdate, or other?)
 /// </summary>
 public void Update()
 {
     if (animationState == ROLAnimState.PLAYING_BACKWARD || animationState == ROLAnimState.PLAYING_FORWARD)
     {
         bool  playing = false;
         int   len     = animationData.Count;
         float time    = animationPosition;
         for (int i = 0; i < len; i++)
         {
             if (animationData[i].updateAnimation(out time))
             {
                 playing = true;
             }
         }
         animationPosition = time;
         //if no longer playing, set the new animation state and inform the callback of the change
         if (!playing)
         {
             ROLAnimState newState = animationState == ROLAnimState.PLAYING_BACKWARD ? ROLAnimState.STOPPED_START : ROLAnimState.STOPPED_END;
             onAnimationStateChange(newState, true);
         }
     }
 }