diff --git a/Assets/SimpleAnimationComponent/SimpleAnimationPlayable.cs b/Assets/SimpleAnimationComponent/SimpleAnimationPlayable.cs index 2b599c8f..b287e740 100644 --- a/Assets/SimpleAnimationComponent/SimpleAnimationPlayable.cs +++ b/Assets/SimpleAnimationComponent/SimpleAnimationPlayable.cs @@ -331,15 +331,7 @@ private bool IsClonePlaying(StateInfo state) public int GetClipCount() { - int count=0; - for (int i = 0; i < m_States.Count; i++) - { - if (m_States[i] != null) - { - count++; - } - } - return count; + return m_States.Count; } private void SetupLerp(StateInfo state, float targetWeight, float time) diff --git a/Assets/SimpleAnimationComponent/SimpleAnimationPlayable_States.cs b/Assets/SimpleAnimationComponent/SimpleAnimationPlayable_States.cs index 876496b4..ae94927c 100644 --- a/Assets/SimpleAnimationComponent/SimpleAnimationPlayable_States.cs +++ b/Assets/SimpleAnimationComponent/SimpleAnimationPlayable_States.cs @@ -365,7 +365,7 @@ public void RemoveAtIndex(int index) { removed.playable.GetGraph().DestroyPlayable(removed.playable); } - m_Count = m_States.Count; + m_Count--; } public bool RemoveClip(AnimationClip clip)