Unity Editor 中有几个不同的功能和窗口使用__曲线__来显示和编辑数据。尽管存在一些例外情况,但可用于查看和操纵曲线的方法在所有这些方面基本相同。
虽然这些控件有细微差别,但都可以使用完全相同的方式对__曲线__进行编辑。本页将介绍如何在这些控件中导航和编辑曲线。
在曲线上双击应当放置__关键点__的位置,即可将关键点添加到曲线中。此外,也可以通过右键单击曲线并从上下文菜单中选择 Add Key 来添加__关键点__。
添加__关键点__后,可使用鼠标将其四处拖动:
另外,还可一次选择多个__关键点__:
通过选定__关键点__并按 Delete 或者通过右键单击关键点并从上下文菜单中选择 __Delete Key__,即可删除关键点。
在曲线编辑器中直接编辑关键点值是 Unity 5.1 中的一项新功能。使用 Enter/Return 或上下文菜单开始编辑选定的关键点,使用 Tab 在字段之间切换,使用 Enter/Return 提交更改,使用 Escape 取消编辑。
使用 __Animation 视图__时,可轻松放大要处理的曲线的细节,或进行缩小以查看全貌。
随时都可以按 F 来完全框选显示的曲线或选定的关键点。
可以使用鼠标的滚轮、触控板的缩放功能或者在用鼠标右键拖动时按住 Alt 键来__缩放__曲线视图。
只能在水平轴或垂直轴上进行缩放:
此外,可以拖动滚动条的端点来缩小或扩展曲线视图中显示的区域。
可以使用鼠标中键拖动或在用鼠标左键拖动时按住 Alt 键来__平移__曲线视图。
一个关键点有两条__切线__:一条在左侧用于向内的斜坡,另一条在右侧用于向外的斜坡。切线可控制关键点之间的曲线形状。可从许多不同的切线类型中进行选择一种类型,用于控制曲线离开一个关键点并到达下一个关键点的方式。右键单击一个关键点可以选择该关键点的切线类型。
要使动画值在通过关键点时实现平滑变化,左右切线必须共线。以下切线类型可确保平滑:
有时可能不希望曲线在通过关键点时是平滑的。要在曲线中产生急剧变化,请选择 Broken 切线模式之一。
使用中断的切线时,可以单独设置左右切线。左右切线中的每一条切线都可以设置为以下类型之一:
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.