-
Notifications
You must be signed in to change notification settings - Fork 0
Animator Extensions
Andrzej Kebab edited this page Feb 2, 2024
·
1 revision
Resets all parameters of the animator to their default values.
animator.ResetParameters();Parameters:
- No parameters.
Returns:
- No return value.
Checks if a parameter with the specified name exists in the animator.
// Example of usage
bool exists = animator.CheckParameterExist("parameterName");Parameters:
-
{string} parameterName: The name of the parameter to check.
Returns:
-
{bool}: True if the parameter exists, false otherwise.
Checks if a parameter with the specified name and type exists in the animator.
// Example of usage
bool exists = animator.CheckParameterExist("parameterName", AnimatorControllerParameterType.Float);Parameters:
-
{string} parameterName: The name of the parameter to check. -
{AnimatorControllerParameterType} type: The type of the parameter to check.
Returns:
-
{bool}: True if the parameter exists and is of the specified type, false otherwise.
Checks if a clip with the specified name exists in the animator.
// Example of usage
bool exists = animator.CheckClipExist("clipName");Parameters:
-
{string} clipName: The name of the clip to check.
Returns:
-
{bool}: True if the clip exists, false otherwise.
Gets the weight of the specified layer in the animator.
// Example of usage
float weight = animator.GetLayerWeight("layerName");Parameters:
-
{string} layerName: The name of the layer to get the weight of.
Returns:
-
{float}: The weight of the specified layer.
Sets the weight of the specified layer in the animator.
// Example of usage
animator.SetLayerWeight("layerName", 0.5f);Parameters:
-
{string} layerName: The name of the layer to set the weight of. -
{float} weight: The weight to set.
Returns:
- No return value.
Checks if a layer with the specified name exists in the animator.
// Example of usage
bool exists = animator.CheckLayerExist("layerName");Parameters:
-
{string} layerName: The name of the layer to check.
Returns:
-
{bool}: True if the layer exists, false otherwise.
Gets the current state information of the specified layer in the animator.
// Example of usage
AnimatorStateInfo stateInfo = animator.GetCurrentAnimatorStateInfo("layerName");Parameters:
-
{string} layerName: The name of the layer to get the state information of.
Returns:
-
{AnimatorStateInfo}: The current state information of the specified layer.