AnimationState.enabled 是否启用?

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的值.如果动画被禁用,在动画再次启用之前,时间(动画)将被暂停.

using UnityEngine;

using System.Collections;



public class example : MonoBehaviour {

	public void Awake() {

		animation["Walk"].enabled = true;

		animation["Walk"].weight = 1.0F;

	}

}

// Enable the walk cycle

// 启用行走动作循环

animation["Walk"].enabled = true;

animation["Walk"].weight = 1.0;
Page last updated: 2011-1-7