查看: 3325|回复: 0
打印 上一主题 下一主题

[Unity 组件参考手册]桌面:动画视图指南之使用动画事件

[复制链接]
.    

3797

主题

11

听众

5万

积分

首席设计师

Rank: 8Rank: 8

纳金币
32328
精华
41

活跃会员 优秀版主 荣誉管理 论坛元老

跳转到指定楼层
楼主
发表于 2013-2-18 17:12:01 |只看该作者 |倒序浏览
The power of animation clips can be increased by using Animation Events, which allow you to call functions in the object's script at specified points in the timeline.动画剪辑中可以添加动画事件,使你在时间轴特定的帧调用脚本中的函数。The function called by an animation event can optionally take one parameter. The parameter can be a float, string, int, object reference or an AnimationEvent object. The AnimationEvent object has member variables that allow a float, string, integer and object reference to be passed into the function all at once, along with other information about the event that triggered the function call.动画事件调用函数时,可以用一个参数。参数可以是float,string,应用对象,或者动画事件对象。函数被调用时,动画事件对象可以将float,string,integer和引用对象等,这些成员变量全部传递给函数。// This JavaScript function can be called by an Animation Event
//这个JavaScript函数会被动画事件调用
function PrintFloat (theValue : float) {
Debug.Log ("rintFloat is called with a value of " + theValue);
}You can add an animation event to a clip at the current playhead position by clicking the Event button or at any point in the animation by double-clicking the Event Line at the point where you want the event to be triggered. Once added, an event can be repositioned by dragging with the mouse. You can delete an event by selecting it and pressing Delete, or by right-clicking on it and selecting Delete Event from the contextual menu.你可以在动画剪辑添加动画事件,在当前播放头的位置,单击"事件"按钮,或在任何时候在动画中通过双击你想要的事件被触发的事件行的地步。添加完毕后,一个事件可以用鼠标拖动来重新定位。你可以选择它,然后按下Delete键,删除事件,或用鼠标右键单击它,并从上下文菜单中选择删除事件。
Animation Events are shown in the Event Line. Add a new Animation Event by double-clicking the Event Line or by using the Event button.
动画事件显示在事件行上。通过双击事件行,或使用"事件"按钮,添加一个新的动画事件。When you add an event, a dialog box will appear to prompt you for the name of the function and the value of the parameter you want to pass to it.当您添加一个事件时,会出现一个对话框,提示你选择你函数和函数所需要的参数。
The Animation Event popup dialog lets you specify which function to call with which parameter value.
在动画事件 对话框上 可以选择函数并输入该函数的参数The events added to a clip are shown as markers in the event line. Holding the mouse over a marker will show a tooltip with the function name and parameter value.添加到剪辑的事件会显示标记在事件轴上。鼠标移动到标记上,可以查看函数的名字和参数。
Holding the mouse cursor over an Animation Event marker will show which function it calls as well as the parameter value.
鼠标移动到动画事件标记上,会显示函数的名字和参数。
【来源:互联网】
更多精彩教程,尽在web3D纳金网http://www.narkii.com/college/
分享到: QQ好友和群QQ好友和群 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
转播转播0 分享淘帖0 收藏收藏0 支持支持0 反对反对0
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

手机版|纳金网 ( 闽ICP备2021016425号-2/3

GMT+8, 2024-11-23 19:32 , Processed in 0.175334 second(s), 33 queries .

Powered by Discuz!-创意设计 X2.5

© 2008-2019 Narkii Inc.

回顶部