Animation.this [string name]  操作名字


var this[name : string] : AnimationState

Description描述

Returns the animation state named name.

返回名称为name的动画状态。

  • C#

  • JavaScript

using UnityEngine;using System.Collections;public class example : MonoBehaviour {public void Awake() {animation["walk"].speed = 2.0F;animation["run"].weight = 0.5F;}}
// Get the walk animation state and set its speed// 取得walk动画状态并设置其速度。animation["walk"].speed = 2.0;// Get the run animation state and set its weight// 取得run动画状态并设置其重量。animation["run"].weight = 0.5;


,