format
typescript
Animator.CrossFade(name, normalized_transition_duration, layer_index, normalized_time_offset, normalized_transition_time)class: Animator
description
Performs a smooth transition between the current animation state and the target animation state.
parameter
| param_name | type | description |
|---|---|---|
| name | string | The name of the target animation state. |
| normalized_transition_duration | number | The duration of the transition in seconds. |
| layer_index | number? | The index of the layer. |
| normalized_time_offset | number? | The offset time of the state (normalized). |
| normalized_transition_time | number? | The transition time (normalized). |
reture
| type | description |
|---|---|
void |
code example
typescript
let obj = new GameObject();
let animator = obj.AddComponent<Animator>(Animator);
animator.CrossFade("name",1,1,1,1);