implicit operator StringHash
Converts a string into its hash, so that you can pass a string where a StringHash is expected.
Read time 1 minuteLast updated 4 hours ago
Definition
- Type: Operator
- Namespace: Unity.Animations
- Assembly: UnityEngine.AnimationCoreModule
implicit operator StringHash(StringHas)
Converts a string into its hash, so that you can pass a string where a StringHash is expected.
[ExcludeFromBurstCompatTesting("Takes managed string")]public static implicit operator StringHash(string str)
Parameters
The string to hash, such as a transform path or a property name.
Returns
Type | Description |
|---|---|
| StringHash | The hash of the string. The hash is 0 if the string is null or empty. |
Remarks
The conversion calls StringHash, so a null or empty string gives a hash of 0. Use it to pass a string where a is expected, for example .
StringHashFindBoneIndex("Hips/Spine")implicit operator StringHash(StringHas)
Converts a into a .
uintStringHashpublic static implicit operator StringHash(uint id)
Parameters
The raw hash value to wrap. It becomes StringHash.Id.
Returns
Type | Description |
|---|---|
| StringHash | A StringHash whose StringHash.Id is |
implicit operator StringHash(StringHas)
Implicitly converts a GenericBinding to a StringHash.
[ExcludeFromBurstCompatTesting("Resolves the script on the main thread")]public static implicit operator StringHash(GenericBinding binding)
Parameters
The GenericBinding to convert.
Returns
Type | Description |
|---|---|
| StringHash | Returns a unique StringHash value for this GenericBinding. |
Remarks
The hash is the same in every session, so you can serialize it. For a MonoBehaviour property, the hash includes the assembly name and full class name of the script, so renaming the script class changes it.