Skip to content

Commit

Permalink
improve anim testing a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
LazyDuchess committed Oct 23, 2024
1 parent d0ca1fe commit fd004db
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Assets/Scripts/OpenTS2/Engine/Tests/SimAnimationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ private void Start()
continue;
}

_animations[animationAsset.AnimResource.ScenegraphResource.ResourceName] = animationAsset;
_animations[animationAsset.AnimResource.ScenegraphResource.ResourceName.ToLowerInvariant()] = animationAsset;
}
UpdateAnimationsListAndGetSelection();

Expand Down Expand Up @@ -121,6 +121,7 @@ private void OnValidate()
_animationObj.AddClip(clip, animName);
}

_animationObj.Play(animName);
StartCoroutine(PlayClipFrameDelayed(animName, anim));
}

Expand All @@ -135,7 +136,7 @@ IEnumerator PlayClipFrameDelayed(string animName, ScenegraphAnimationAsset anim)

private ScenegraphAnimationAsset UpdateAnimationsListAndGetSelection()
{
var matchedAnimations = _animations.Where(pair => pair.Key.StartsWith(animationName));
var matchedAnimations = _animations.Where(pair => pair.Key.Contains(animationName.ToLowerInvariant()));
var tenMatchedAnimations = matchedAnimations.Take(10).ToArray();

// Display 10 matching animations.
Expand Down

0 comments on commit fd004db

Please sign in to comment.