Skip to content
This repository has been archived by the owner on Jun 3, 2020. It is now read-only.

[issue #30] Fixed an issue where removing a clip would cause nullreference issues #31

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions Assets/SimpleAnimationComponent/SimpleAnimationPlayable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down