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; }
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; }