Skip to content

Commit 520c8c1

Browse files
committed
Implicitly convert AnimatorParameter to int
1 parent b75dbc0 commit 520c8c1

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Runtime/DataStructures/AnimatorParameter.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,18 @@ public AnimatorParameter(string name)
5757
_hash = Animator.StringToHash(name);
5858
}
5959

60-
/// <param name="name">The name of the animation parameter.</param>
60+
/// <summary>
61+
/// Implicitly converts a name to an animator parameter.
62+
/// </summary>
63+
/// <param name="name">The name of the animator parameter.</param>
6164
public static implicit operator AnimatorParameter(string name) => new AnimatorParameter(name);
6265

66+
/// <summary>
67+
/// Implicitly converts an animator parameter to a hash id.
68+
/// </summary>
69+
/// <param name="property">The animator parameter to convert to an id.</param>
70+
public static implicit operator int(AnimatorParameter property) => property.hash;
71+
6372
}
6473

6574
}

0 commit comments

Comments
 (0)