File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,16 @@ public struct AnimatorParameter
1616 /// <summary>
1717 /// The hash id of the animation parameter.
1818 /// </summary>
19- public int hash => _hash ;
19+ public int hash
20+ {
21+ get
22+ {
23+ if ( _hash == 0 ) {
24+ _hash = Animator . StringToHash ( _name ) ;
25+ }
26+ return _hash ;
27+ }
28+ }
2029
2130 [ SerializeField ]
2231 [ Tooltip ( "The name of the animation parameter." ) ]
@@ -44,15 +53,6 @@ public AnimatorParameter(string name)
4453 _hash = Animator . StringToHash ( name ) ;
4554 }
4655
47- /// <summary>
48- /// Generates a new hash for the parameter using the current name.
49- /// </summary>
50- public int GenerateHash ( )
51- {
52- _hash = Animator . StringToHash ( _name ) ;
53- return _hash ;
54- }
55-
5656 public static implicit operator AnimatorParameter ( string name ) => new AnimatorParameter ( name ) ;
5757
5858 }
You can’t perform that action at this time.
0 commit comments