From fd004db9b1ec1d8fe71c0cbb431e9c35340c404e Mon Sep 17 00:00:00 2001 From: Nahuel Rocchetti Date: Tue, 22 Oct 2024 23:39:27 -0300 Subject: [PATCH] improve anim testing a bit --- Assets/Scripts/OpenTS2/Engine/Tests/SimAnimationTest.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/OpenTS2/Engine/Tests/SimAnimationTest.cs b/Assets/Scripts/OpenTS2/Engine/Tests/SimAnimationTest.cs index f5923fcb..6c0019b1 100644 --- a/Assets/Scripts/OpenTS2/Engine/Tests/SimAnimationTest.cs +++ b/Assets/Scripts/OpenTS2/Engine/Tests/SimAnimationTest.cs @@ -45,7 +45,7 @@ private void Start() continue; } - _animations[animationAsset.AnimResource.ScenegraphResource.ResourceName] = animationAsset; + _animations[animationAsset.AnimResource.ScenegraphResource.ResourceName.ToLowerInvariant()] = animationAsset; } UpdateAnimationsListAndGetSelection(); @@ -121,6 +121,7 @@ private void OnValidate() _animationObj.AddClip(clip, animName); } + _animationObj.Play(animName); StartCoroutine(PlayClipFrameDelayed(animName, anim)); } @@ -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.