format
typescript
Animation.playAutomaticallyclass: Animation
description
Whether the default animation clip should automatically start playing on startup.
If the return value is true, the animation clip will automatically play when the game object is enabled. If it is false, the animation needs to be triggered manually through code or other means.
parameter
| param_name | type | description |
|---|
reture
| type | description |
|---|---|
boolean | Whether to play automatically on startup |
code example
typescript
let animation = this.gameObject.GetComponent<Animation>(Animation);
let play_auto = animation.playAutomatically;