1.Animator Controller (Animator controller in Unity is a file type that exists as a separate profile, followed by a controller):
- Multiple animations can be integrated;
- The use of state machine to achieve animation playback and switching;
- can achieve animation fusion and layered playback;
- Animation playback can be controlled in depth with a script.
2.Animator components:
- Controller: The animator controller file used.
- Avatar: The skeleton file used.
- Apply Root Motion: Whether the position of the gameobject that binds the component can be changed by the animation (if there is an animation that changes the displacement).
- Update mode: Normal means update with update, Animate physics means update with fixupdate (typically used in case of interaction with object), Unscale Time represents an update that ignores timescale (typically used in UI animations).
- Culling mode: Always animate means that even if the camera does not see the update to be animated, cull update transform indicates that the camera stops playing when it is invisible but the location continues to update, cull Completely all updates that stop the animation when the camera is invisible.
3.Animator Controller
- Entry: Indicates that when entering the current state, the state of the connected state becomes the first state after entering the state machine;
- Any state: Represents an arbitrary status, and its function is that the state it points to can be toggled in the past at any time;
- Exit: Indicates exiting the current state machine, if any state points to the exit, indicating that the current state machine can be exited from the specified state;
4. Status switch:
In Mecanim, the play between animations is no longer switched by invoking a method such as "play", but rather by the transformation of the parameter (Parameters) to animate the state.
We open the parameters panel, which is used to set the various parameters used by the state machine, as follows:
Click the plus sign to create a parameter that allows us to create 4 types of parameters in unity:
The parameters of the Float:float type are used to control the floating-point parameters inside the state machine.
The parameters of the Int:int type are used to control the integer parameters inside the state machine.
Bool:bool type parameter, more for state switching;
Trigger: is essentially a bool type parameter, but its value defaults to false, and when set to True, the system automatically reverts it to false;
Establishes a state of iswalk. We click on the line to set the conditions for the transition in the Inspector window.
5.
Has Exit time
If we tick the item, the animation will wait for the current animation to finish before converting to the next animation, if the current animation is looping animation will wait for this time to complete the conversion, so for the need to convert the animation immediately remember to uncheck the box.
In another case, when my current animation is finished, it automatically transitions to the next state (no other jump condition) that the arrow refers to, which must be checked at this point, otherwise the animation will be stuck at the last frame, and if the loop animation will be played back.
6. How to toggle animation; animator. Setbool ("The parameter name set in the parameters of the goods", value); In this case, animator. Setbool ("Iswalk", true); Let's keep it walking.
Animator Controller Study Notes