Beispiel #1
0
 protected virtual void OnEnable()
 {
     mTransform = transform;
     if (resetOnEnable && meshFilter)
     {
         if (playAutomatically)
         {
             Play(defaultAnimation.AnimationName);
         }
         else
         {
             isPaused = true;
         }
         if (currentAnimation != null)
         {
             currentAnimation.GenerateFrame(baseMesh, currentFrame);
             currentAnimation.DisplayFrame(this, currentFrame, -1);
         }
     }
     if (Application.isPlaying)
     {
         MeshAnimatorManager.AddAnimator(this);
     }
     lastFrameTime = Time.time;
 }
Beispiel #2
0
 private void OnDisable()
 {
     MeshAnimatorManager.RemoveAnimator(this);
     currentCrossFade.Reset();
     currentAnimIndex = -1;
     pingPong         = false;
     if (queuedAnims != null)
     {
         queuedAnims.Clear();
     }
 }
Beispiel #3
0
 protected virtual void OnDisable()
 {
     if (Application.isPlaying)
     {
         MeshAnimatorManager.RemoveAnimator(this);
     }
     currentAnimIndex = -1;
     pingPong         = false;
     if (queuedAnims != null)
     {
         queuedAnims.Clear();
     }
 }
Beispiel #4
0
 private void OnEnable()
 {
     mTransform = transform;
     if (resetOnEnable && meshFilter)
     {
         if (playAutomatically)
         {
             Play(defaultAnimation.name);
         }
         else
         {
             isPaused = true;
         }
         if (currentAnimation != null)
         {
             currentAnimation.GenerateFrameIfNeeded(baseMesh, currentFrame);
             currentAnimation.DisplayFrame(meshFilter, currentFrame, -1);
         }
     }
     MeshAnimatorManager.AddAnimator(this);
     lastFrameTime = Time.time;
 }