yeah that's about it (#591)

works perfectly, looks better, easier to type, and more efficient. what's there to hate
This commit is contained in:
AstrlJelly
2023-12-05 20:59:36 -05:00
committed by GitHub
parent d7c6533f61
commit 87653b0d65
12 changed files with 27 additions and 37 deletions

View File

@ -14,11 +14,12 @@ namespace HeavenStudio.Util
/// Returns true if animName is currently playing on animator
/// </summary>
/// <param name="anim">Animator to check</param>
/// <param name="animName">name of animation to look out for</param>
public static bool IsPlayingAnimationName(this Animator anim, string animName)
/// <param name="animNames">name(s) of animation to look out for</param>
public static bool IsPlayingAnimationNames(this Animator anim, params string[] animNames)
{
var stateInfo = anim.GetCurrentAnimatorStateInfo(0);
return (stateInfo.normalizedTime < stateInfo.speed || stateInfo.loop) && stateInfo.IsName(animName);
var isPlaying = Array.Exists(animNames, animName => stateInfo.IsName(animName));
return (stateInfo.normalizedTime < stateInfo.speed || stateInfo.loop) && isPlaying;
}
/// <summary>