Skip to content

Commit 28ef310

Browse files
committed
chore(Util): Accept hash state too
1 parent 7709280 commit 28ef310

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Assets/JCSUnity/Scripts/Util/JCS_Animator.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,15 @@ public static bool HasLayer(Animator animator, int index)
5555
/// Like `Animator.HasState` but make second paramter
5656
/// accepts the string.
5757
/// </summary>
58+
public static bool HasState(Animator animator, int layer, int name)
59+
{
60+
// First check if the layer exists.
61+
if (!HasLayer(animator, layer))
62+
return false;
63+
64+
// Then do the check.
65+
return animator.HasState(layer, name);
66+
}
5867
public static bool HasState(Animator animator, int layer, string name)
5968
{
6069
// First check if the layer exists.

0 commit comments

Comments
 (0)