var enabled : bool
Description描述
Enables / disables the animation.
启动/禁止动画
For the animation to take any effect the weight also needs to be set to a value higher than zero. If the animation is disabled, time will be paused until the animation is enabled again.
对于需要采用某些效果的动画,权值要设置成为一个大于0的值.如果动画被禁用,在动画再次启用之前,时间(动画)将被暂停. 【狗刨学习网】
JavaScript
using UnityEngine;using System.Collections;public class example : MonoBehaviour { public void Awake() { animation["Walk"].enabled =
true; animation["Walk"].weight = 1.0F; }}
1.// Enable the walk cycle
2.// 启用行走动作循环
3.
4.animation["Walk"].enabled = true;
5.
6.animation["Walk"].weight = 1.0;
复制代码
C#
https://www.sodocs.net/doc/d718872332.html,ing UnityEngine;
https://www.sodocs.net/doc/d718872332.html,ing System.Collections;
3.
4.
5.public class example : MonoBehaviour
6.{
7. public void Awake()
8. {
9. animation["Walk"].enabled = true;
10. animation["Walk"].weight = 1.0F;
11. }
12.
13.}
复制代码