Ejemplo n.º 1
0
 //实现循环更新
 private static void UpdateFrameFuncLoop(FrameAnimation frameAnimation)
 {
     if (frameAnimation.nCurFrame >= frameAnimation.nLength || frameAnimation.nCurFrame < 0)
     {
         frameAnimation.nCurFrame = frameAnimation.nStartFrame;
     }
 }
Ejemplo n.º 2
0
 //实现单次更新
 private static void UpdateFrameFuncOnce(FrameAnimation frameAnimation)
 {
     if (frameAnimation.nCurFrame >= frameAnimation.nLength || frameAnimation.nCurFrame < 0)
     {
         frameAnimation.Stop();
         if (frameAnimation.iFrameUpdater != null)
         {
             frameAnimation.iFrameUpdater.OnComplete();
         }
     }
 }
Ejemplo n.º 3
0
 //实现来回更新
 private static void UpdateFrameFuncPingPong(FrameAnimation frameAnimation)
 {
     if (frameAnimation.nSign == 1)
     {
         if (frameAnimation.nCurFrame >= frameAnimation.nLength)
         {
             frameAnimation.nSign      = -1;
             frameAnimation.nCurFrame -= 2;
         }
     }
     else
     {
         if (frameAnimation.nCurFrame < 0)
         {
             frameAnimation.nSign      = 1;
             frameAnimation.nCurFrame += 2;
         }
     }
 }