找回密碼
 注冊帳號

掃一掃,訪問微社區

animation.playqueued 播放隊列

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

摘要: animation.playqueued 播放隊列functionplayqueued(animation: string,queue:queuemode=queuemode.completeothers,mode:playmode=playmode.stopsamelayer) :animationstatedescription描述plays an animation after ...

animation.playqueued 播放隊列

functionplayqueued(animation: string,queue:queuemode=queuemode.completeothers,mode:playmode=playmode.stopsamelayer) :animationstate

description描述

plays an animation after previous animations has finished playing.

在前一個動畫播放完成之后直接播放下一個動畫。

for example you might play a specific sequeue of animations after each other.

比如你可能會一個接一個播放一個特殊序列的動畫。

the animation state duplicates itself before playing thus you can fade between the same animation. this can be used to overlay two same animations. for example you might have a sword swing animation. the player slashes two times quickly after each other. you could rewind the animation and play from the beginning but then you will get a jump in the animation.

動畫狀態在播放之前會復制自己,因此你可以在相同的動畫之間進行淡入淡出。這個可以用于覆蓋兩個相同的動畫。比如你可能有一個劍揮舞的動畫,玩家連續快速削兩次。你可以倒播這個動畫然后從頭再播放但是你會看到動畫之間有跳越現象。

the followingqueue modesare available:

if queue isqueuemode.completeothersthis animation will only start once all other animations have stopped playing.

if queue isqueuemode.playnowthis animation will start playing immediately on a duplicated animation state.

下面幾個模式可用:

如果queue是queuemode.completeothers,當所有其他動畫停止播放,這個動畫才會開始。

如果queue是queuemode.playnow,這個動畫將在一個重復的動畫狀態下立即開始播放。

after the animation has finished playing it will automatically clean itself up. using the duplicated animation state after it has finished will result in an exception.

當動畫完成播放之后,它會自動清理。在一個動畫狀態結束之后使用它,將會導致一個異常。

c#

javascript

using unityengine;

using system.collections;

public class example :monobehaviour{

void update() {

if (input.getbuttondown("fire1"))

animation.playqueued("shoot",queuemode.playnow);

}

}

function update () {

if (input.getbuttondown("fire1"))

animation.playqueued("shoot",queuemode.playnow);

}

相關閱讀

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