Unity 编辑器中有多个不同的功能和窗口使用曲线来显示和编辑数据。您用于查看和操作曲线的方法在所有这些区域中基本相同,尽管也有一些例外。
虽然这些控件存在细微差别,但所有控件中的曲线都以完全相同的方式进行编辑。此页面说明如何在这些控件中导航和编辑曲线。
您可以通过在要添加关键帧的曲线位置双击来添加曲线关键帧。您也可以右键单击曲线,然后从上下文菜单中选择添加关键帧。
添加后,可以使用鼠标移动关键帧
也可以一次选择多个关键帧
可以通过选择关键帧并按Delete键,或右键单击它们并从上下文菜单中选择删除关键帧来删除关键帧。
在曲线编辑器中直接编辑关键帧值是 Unity 5.1 中的新功能。使用Enter/Return或上下文菜单开始编辑选定的关键帧,使用Tab键在字段之间切换,使用Enter/Return键确认,使用Escape键取消编辑。
在使用动画视图时,您可以轻松放大要处理的曲线的细节,或缩小以获得完整视图。
您可以随时按F键以完全选择显示的曲线或选定的关键帧。
您可以使用鼠标滚轮、触控板的缩放功能或按住Alt键的同时右键拖动鼠标来缩放一个相机控件,允许您缩放屏幕上的视图。要缩放 Unity 编辑器中的相机,请按 Alt + 右键单击并拖动。 更多信息
参见术语表曲线视图。
您只能在水平或垂直轴上缩放
此外,您可以拖动滚动条的端盖以缩小或扩大曲线视图中显示的区域。
您可以通过鼠标中键拖动或按住Alt键的同时左键拖动鼠标来平移曲线视图。
一个关键帧有两个切线 - 一个在左侧用于进入斜率,一个在右侧用于离开斜率。切线控制关键帧之间曲线的形状。您可以从多种不同的切线类型中进行选择,以控制曲线离开一个关键帧并到达下一个关键帧的方式。右键单击一个关键帧以选择该关键帧的切线类型。
为了使动画值在经过关键帧时平滑变化,左右切线必须共线。以下切线类型确保平滑性
有时您可能不希望曲线在经过关键帧时平滑。要创建曲线的急剧变化,请选择其中一种断开切线模式。
使用断开切线时,可以分别设置左右切线。左右切线中的每一个都可以设置为以下类型之一
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.