コード例 #1
0
 /// <summary>
 /// Stops currently playing <see cref="Animation"/>
 /// </summary>
 public new void ResetCurrentAnimation()
 {
     IsAnimated = false;
     if (ObjectAnimation != null)
     {
         ObjectAnimation.CurrentFrame = 0;
         this.CurrentTexture          = new Texture(ObjectAnimation.GetFrame(ObjectAnimation.CurrentFrame), TextureLayout.Stretch);
     }
 }
コード例 #2
0
ファイル: MainObject.cs プロジェクト: RemiRigal/Unity-Vibes
 private void Update()
 {
     if (objectAnimation != null && objectAnimation.animate)
     {
         AnimationFrame frame = objectAnimation.GetFrame(Time.deltaTime);
         if (frame != null)
         {
             transform.position = frame.position;
             transform.rotation = frame.rotation;
         }
     }
 }
コード例 #3
0
 internal void InternalUpdate()
 {
     //UpdateCollider();
     if (IsAnimated)
     {
         ObjectAnimation.CountedTicks++;
         if (ObjectAnimation.CountedTicks == ObjectAnimation.FrameTickTrigger)
         {
             ObjectAnimation.CountedTicks = 0;
             if (ObjectAnimation.CurrentFrame == ObjectAnimation.AnimationFramesCount - 1)
             {
                 ObjectAnimation.CurrentFrame = 0;
             }
             else
             {
                 ObjectAnimation.CurrentFrame++;
             }
         }
         this.CurrentTexture = new Texture(ObjectAnimation.GetFrame(ObjectAnimation.CurrentFrame), TextureLayout.Stretch);
     }
 }