找回密碼
 注冊帳號

掃一掃,訪問微社區

animation.crossfadequeued 淡入淡出隊列

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

摘要: animation.crossfadequeued 淡入淡出隊列functioncrossfadequeued(animation: string,fadelength: float = 0.3f,queue:queuemode=queuemode.completeothers,mode:playmode=playmode.stopsamelayer) :animationstated ...

animation.crossfadequeued 淡入淡出隊列

functioncrossfadequeued(animation: string,fadelength: float = 0.3f,queue:queuemode=queuemode.completeothers,mode:playmode=playmode.stopsamelayer) :animationstate

description描述

cross fades an animation after previous animations has finished playing.

在前一個動畫播放完成之后淡入淡出下一個動畫。

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

例如你可以播放一個特定的動畫序列。

the animation 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.

動畫在播放前復制自身,因此你可以再相同的動畫間漸變,這可用來重疊兩個相 同的動畫。例如你可能有一個揮劍的動畫,玩家快速揮動了2次,你可以回放這個動畫并從開始播放它,但會跳幀。

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 modes:

如果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.crossfadequeued("shoot", 0.3f,queuemode.playnow);

}

}

function update () {

if (input.getbuttondown("fire1"))

animation.crossfadequeued("shoot", 0.3,queuemode.playnow);

}

相關閱讀

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