AnimationAction - CodingDino/Dino-Unity-Toolkit GitHub Wiki
The AnimationAction component changes the values for parameters on an Animator component attached to the same GameObject, or a specified animator on a different GameObject. This can be used for playing walking or jumping animations, or any other animation you may have.
This is an Action component, and therefore must be triggered by a separate Activator component. Actions, Activators, and Data make up the core system for the Dino Unity Toolkit.
Image: AnimationAction attached to a player.
Image: AnimationAction is being used to change the values of the parameter on this animator, using an InputAxisActivator for movement and OnTrigger2DActivator for jumping.
Image: The above animator in action in the scene.
Properties
Property: | Description: |
---|---|
Parameter Name | The parameter that will be set. Can be changed via Action. |
Use Different Animator | Should we use an animator on a different GameObject other than this one? |
Animator Object | Only used if Use Different Animator is set to true. The animator that will be used. |
Actions
This component has several Action functions that can be triggered by Activators.
ActionSetParameterName()
This action should be taken before setting a parameter's value - it is used to change what parameter will be affected by the value change for future Actions.
Parameter: | Description: |
---|---|
NewParameter | The name of the parameter that will be affected by future value change Actions. |
ActionSetFloatParameter()
This will change the value of the current parameter in the animator. Use this for float (decimal number) type values.
Parameter: | Description: |
---|---|
New Value | The new value that the parameter will be changed to. |
ActionSetIntParameter()
This will change the value of the current parameter in the animator. Use this for int (whole number) type values.
Parameter: | Description: |
---|---|
New Value | The new value that the parameter will be changed to. |
ActionSetBoolParameter()
This will change the value of the current parameter in the animator. Use this for bool (true of false) type values.
Parameter: | Description: |
---|---|
New Value | The new value that the parameter will be changed to. |
ActionSetTriggerParameter()
This will trigger the current parameter in the animator. Use this for triggers, which don't have values.