找回密碼
 注冊帳號

掃一掃,訪問微社區

animation.addclip 添加剪輯

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

摘要: animation.addclip 添加剪輯functionaddclip(clip:animationclip,newname: string) : voiddescription描述adds a clip to the animation with name newname.給動畫添加一個名稱為newname的動畫剪輯。c#javascriptusi ...

animation.addclip 添加剪輯

functionaddclip(clip:animationclip,newname: string) : void

description描述

adds a clip to the animation with name newname.

動畫添加一個名稱為newname的動畫剪輯。

c#

javascript

using unityengine;

using system.collections;

public class example :monobehaviour{

public animationclip walkclip;

public void awake() {

animation.addclip(walkclip, "walk");

}

}

var walkclip : animationclip;

animation.addclip(walkclip, "walk");

o functionaddclip(clip:animationclip,newname: string,firstframe: int,lastframe: int,addloopframe: bool = false) : void

description描述

adds clip to the only play between firstframe and lastframe. the new clip will also be added to the animation with name newname.

在播放的firstframe和lastframe之間添加動畫剪輯。新的動畫剪輯也會被添加到名稱為newname的動畫中。

addloopframe: should an extra frame be inserted at the end that matches the first frame? turn this on if you are making a looping animation. if a clip with that name already exists it will be replaced with the new clip.

addloopframe: 是否在第一幀之后添加一個額外的幀?如果你在制作一個循環的動畫,那么可以打開這個選項。如果那么名稱的動畫剪輯已經存在,那么會被新的動畫剪輯覆蓋。

c#

javascript

using unityengine;

using system.collections;

public class example :monobehaviour{

public void awake() {

animation.addclip(animation.clip, "shoot", 0, 10);

animation.addclip(animation.clip, "walk", 11, 20, true);

animation.addclip(animation.clip, "idle", 21, 30, true);

}

}

// split the default clip into a shoot, walk and idle animation

// 把默認的動畫剪輯拆分成一個shoot,walk和idle的動畫。

animation.addclip(animation.clip, "shoot", 0, 10);

// walk and idle will add an extra looping frame at the end

// walk和idle動畫剪輯會在結尾被添加一個額外的循環幀。

animation.addclip(animation.clip, "walk", 11, 20, true);

animation.addclip(animation.clip, "idle", 21, 30, true);

相關閱讀

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