找回密碼
 注冊帳號

掃一掃,訪問微社區

animation.sample 采樣

2014-12-31 02:26| 發布者: 楊炎| 查看: 1719| 評論: 0|原作者: 蠻牛|來自: unity3d腳本manual

摘要: animation.sample 采樣functionsample() : voiddescription描述samples animations at the current state.在當前狀態對動畫進行采樣。this is useful when you explicitly want to set up some animation state, and ...

animation.sample 采樣

functionsample() : void

description描述

samples animations at the current state.

在當前狀態對動畫進行采樣。

this is useful when you explicitly want to set up some animation state, and sample it once.

當你明確想設置一些動畫狀態并且對它取樣一次的時候有用。

c#

javascript

using unityengine;

using system.collections;

public class example :monobehaviour{

public void awake() {

animation["myclip"].time = 2.0f;

animation["myclip"].enabled = true;

animation.sample();

animation["myclip"].enabled = false;

}

}

// set up some state;

// 設置一些狀態;

animation["myclip"].time = 2.0;

animation["myclip"].enabled = true;

// sample animations now.

// 取樣動畫。

animation.sample();

animation["myclip"].enabled = false;

文章點評
女校游泳队彩金