Unity3D圣典3.3版本-中文版
文集大纲加载中……
本文档使用 MrDoc 发布
-
+
首页
Animation.AddClip 添加剪辑
# [Animation](Animation.html).AddClip 添加剪辑 function *AddClip* (*clip* : [AnimationClip](../AnimationClip/AnimationClip.html), *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"); ``` • function *AddClip* (*clip* : [AnimationClip](../AnimationClip/AnimationClip.html), *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); ```
da
2022年5月13日 22:04
转发文档
收藏文档
上一篇
下一篇
手机扫码
复制链接
手机扫一扫转发分享
复制链接
关于 MrDoc
觅思文档MrDoc
是
州的先生
开发并开源的在线文档系统,其适合作为个人和小型团队的云笔记、文档和知识库管理工具。
如果觅思文档给你或你的团队带来了帮助,欢迎对作者进行一些打赏捐助,这将有力支持作者持续投入精力更新和维护觅思文档,感谢你的捐助!
>>>捐助鸣谢列表
微信
支付宝
QQ
PayPal
Markdown文件
分享
链接
类型
密码
更新密码