animation.addclip 添加剪辑

2014-12-31 01:18| 发布者: 杨炎| 查看: 2323| 评论: 0|原作者: 蛮牛|来自: yzc88亚洲城脚本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);

相关阅读

文章点评
相关文章