格式
typescript
Animation.playAutomatically所属类: Animation
描述
默认动画剪辑是否应该在启动时自动开始播放。
如果返回值为true,则动画剪辑将在游戏对象启用时自动播放;如果为false,则需要通过代码或者其他方式手动触发播放。
参数
| 参数名 | 类型 | 描述 |
|---|
返回值
| 类型 | 描述 |
|---|---|
boolean | 是否在启动时自动播放 |
代码示例
typescript
let animation = this.gameObject.GetComponent<Animation>(Animation);
let play_auto = animation.playAutomatically;