找回密碼
 注冊帳號

掃一掃,訪問微社區

animation.play 播放

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

摘要: animation.play 播放functionplay(mode:playmode=playmode.stopsamelayer) : boolfunctionplay(animation: string,mode:playmode=playmode.stopsamelayer) : booldescription描述plays animation without any blendi ...

animation.play 播放

functionplay(mode:playmode=playmode.stopsamelayer) : bool

functionplay(animation: string,mode:playmode=playmode.stopsamelayer) : bool

description描述

plays animation without any blending.

沒有任何混合的動畫" target="_blank" class="relatedlink">播放動畫。

play() will start animation with name animation, or play the default animation. the animation will be played abruptly without any blending.

play()將開始播放名稱為animation的動畫,或者播放默認動畫。動畫會突然開始播放而沒有任何混合。

if mode is playmode.stopsamelayer then all animations in the same layer will be stopped. if mode is playmode.stopall then all animations currently playing will be stopped.

如果模式是playmode.stopsamelayer,那么所有在同一個層的動畫將停止播放。如果模式是playmode.stopall,那么所有當前在播放的動畫將停止播放。

if the animation is already playing, other animations will be stopped but the animation will not rewind to the beginning.

如果動畫已經在播放過程中,別的動畫將停止但是動畫不會回退到開始位置。

if the animation is not set to be looping it will be stopped and rewinded after playing.

如果動畫沒有被設置成循環模式,它將停止并且回退到開始位置。

play() will return false if animation can't be played (no animation clip or no default animation).

如果動畫不能被播放(沒有動畫剪輯或者沒有默認動畫),play()將返回false。

c#

javascript

using unityengine;

using system.collections;

public class example :monobehaviour{

public void awake() {

animation.play();

}

}

// plays the default animation

// 播放默認動畫。

animation.play();

for a specific animation, you can call the animation with play as well.

對于特別的動畫,你也可以調用play來播放動畫。

c#

javascript

using unityengine;

using system.collections;

public class example :monobehaviour{

public void awake() {

animation.play("walk");

animation.play("walk",playmode.stopall);

}

}

// plays the walk animation - stops all other animations in the same layer

// 播放walk動畫 - 停止同一層的其他動畫。

animation.play("walk");

// plays the walk animation - stops all other animations

// 播放walk動畫 - 停止其他動畫。

animation.play("walk",playmode.stopall);

相關閱讀

文章點評
相關文章
女校游泳队彩金