TryGet
Gets the skeleton node that has an identifier.
Read time 3 minutesLast updated 4 hours ago
Definition
- Type: Method
- Namespace: Unity.Animations
- Assembly: UnityEngine.AnimationCoreModule
TryGet(StringHash, SkeletonNode)
Gets the skeleton node that has an identifier.
public bool TryGet(StringHash id, out SkeletonNode node)
Parameters
The SkeletonNode.Id of the node to get.
When the method returns, the node that has the identifier, or the default value if there's none.
Returns
Type | Description |
|---|---|
| bool | True if the builder has a node with the identifier. Otherwise, false. |
Remarks
Use this method to read the default values of a bone. To change them, use RigBuilder.TrySetBoneDefaultTranslation, RigBuilder.TrySetBoneDefaultRotation, and RigBuilder.TrySetBoneDefaultScale.
TryGet(int, SkeletonNode)
Gets the skeleton node at a bone index.
public bool TryGet(int boneIndex, out SkeletonNode node)
Parameters
The bone index of the node to get.
When the method returns, the node at the bone index, or the default value if the index is out of range.
Returns
Type | Description |
|---|---|
| bool | True if the builder has a node at the bone index. Otherwise, false. |
Remarks
The bone index of a node is its index in the builder, which becomes its bone index in the RigDefinition. To get the bone index of a node from its identifier, use RigBuilder.GetBoneIndex.
TryGet(StringHash, LocalTranslationChannel)
Gets the skeleton node that has an identifier.
public bool TryGet(StringHash id, out LocalTranslationChannel channel)
Parameters
Returns
Type | Description |
|---|---|
| bool | True if the builder has a node with the identifier. Otherwise, false. |
Remarks
Use this method to read the default values of a bone. To change them, use RigBuilder.TrySetBoneDefaultTranslation, RigBuilder.TrySetBoneDefaultRotation, and RigBuilder.TrySetBoneDefaultScale.
TryGet(StringHash, LocalRotationChannel)
Gets the skeleton node that has an identifier.
public bool TryGet(StringHash id, out LocalRotationChannel channel)
Parameters
Returns
Type | Description |
|---|---|
| bool | True if the builder has a node with the identifier. Otherwise, false. |
Remarks
Use this method to read the default values of a bone. To change them, use RigBuilder.TrySetBoneDefaultTranslation, RigBuilder.TrySetBoneDefaultRotation, and RigBuilder.TrySetBoneDefaultScale.
TryGet(StringHash, LocalScaleChannel)
Gets the skeleton node that has an identifier.
public bool TryGet(StringHash id, out LocalScaleChannel channel)
Parameters
Returns
Type | Description |
|---|---|
| bool | True if the builder has a node with the identifier. Otherwise, false. |
Remarks
Use this method to read the default values of a bone. To change them, use RigBuilder.TrySetBoneDefaultTranslation, RigBuilder.TrySetBoneDefaultRotation, and RigBuilder.TrySetBoneDefaultScale.
TryGet(StringHash, FloatChannel)
Gets the skeleton node that has an identifier.
public bool TryGet(StringHash id, out FloatChannel channel)
Parameters
Returns
Type | Description |
|---|---|
| bool | True if the builder has a node with the identifier. Otherwise, false. |
Remarks
Use this method to read the default values of a bone. To change them, use RigBuilder.TrySetBoneDefaultTranslation, RigBuilder.TrySetBoneDefaultRotation, and RigBuilder.TrySetBoneDefaultScale.
TryGet(StringHash, IntChannel)
Gets the skeleton node that has an identifier.
public bool TryGet(StringHash id, out IntChannel channel)
Parameters
Returns
Type | Description |
|---|---|
| bool | True if the builder has a node with the identifier. Otherwise, false. |
Remarks
Use this method to read the default values of a bone. To change them, use RigBuilder.TrySetBoneDefaultTranslation, RigBuilder.TrySetBoneDefaultRotation, and RigBuilder.TrySetBoneDefaultScale.
TryGet(StringHash, EntityIdChannel)
Gets the skeleton node that has an identifier.
public bool TryGet(StringHash id, out EntityIdChannel channel)
Parameters
Returns
Type | Description |
|---|---|
| bool | True if the builder has a node with the identifier. Otherwise, false. |
Remarks
Use this method to read the default values of a bone. To change them, use RigBuilder.TrySetBoneDefaultTranslation, RigBuilder.TrySetBoneDefaultRotation, and RigBuilder.TrySetBoneDefaultScale.