format
typescript
Animator.GetBool(name)class: Animator
description
Gets the current value of a boolean parameter with the specified parameter name.
parameter
| param_name | type | description |
|---|---|---|
| name | string | The name of the parameter. |
reture
| type | description |
|---|---|
boolean|undefined | True if the parameter's current value is successfully retrieved; otherwise, false (returns false when the parameter name is empty or the parameter type is inconsistent).The current value of the parameter. |
code example
typescript
let obj = new GameObject();
let animator = obj.AddComponent<Animator>(Animator);
animator.GetBool("bool0");