Use the Timeline Editor window to create cut-scenes, cinematics, and game-play sequences by visually arranging tracks and clips linked to GameObjects in your scene.
For each cut-scene, cinematic, or game-play sequence, the Timeline Editor window saves the following:
Timeline Asset: stores the tracks, clips, and recorded animations without links to the specific GameObjects being animated. The Timeline Asset is saved to the project.
Timeline instance: stores links to the specific GameObjects being animated by the Timeline Asset. These links, referred to as bindings, are saved to the scene.
The Timeline Editor window saves track and clip definitions as a Timeline Asset. If you record key animations while creating your cinematic, cut-scene, or game-play sequence, the Timeline Editor window saves the recorded animation as children of the Timeline Asset.
Although a Timeline Asset defines the tracks and clips for a cut-scene, cinematic, or game-play sequence, you cannot add a Timeline Asset directly to a scene. To animate GameObjects in your scene with a Timeline Asset, you must create a Timeline instance.
The Timeline Editor window provides an automated method of creating a Timeline instance while creating a Timeline Asset.
If you select a GameObject in the scene that has a Playable Director component associated with a Timeline Asset, the bindings appear in the Timeline Editor window and in the Playable Director component (Inspector window).
Since Timeline Assets and Timeline instances are separate, it is possible to reuse the same Timeline Asset with many Timeline instances.
For example, you can create a Timeline Asset named VictoryTimeline with the animation, music, and particle effects that play when the main game character (Player) is victorious. To reuse the VictoryTimeline Timeline Asset to animate another game character (Enemy) in the same scene, you can create another Timeline instance for the secondary game character.
Since the Timeline Asset is being reused, any modification to the Timeline Asset in the Timeline Editor window results in changes to all Timeline instances.
For example, in the previous example, if you delete the Fireworks Control track in the Timeline Editor window while modifying the Player Timeline instance, the track is removed from the VictoryTimeline Timeline Asset. This also removes the Fireworks control track from all instances of the VictoryTimeline Timeline Asset, including the Enemy Timeline instance.
Timeline 窗口可用于创建影片内容、游戏序列、音频序列和复杂的粒子效果。可以在同一序列(例如有角色与景物交互的过场动画或脚本序列)中为许多不同的游戏对象设置动画。在 Timeline 窗口中,可以有多种类型的轨道,每个轨道可以包含多个可以移动、修剪和混合的剪辑。这对于创建更复杂的动画序列非常有用,因为这些动画序列需要将许多不同的游戏对象编排在一起。
Timeline 窗口比 Animation 窗口更晚推出。它是在版本 2017.1 中添加到 Unity 的,并取代了 Animation 窗口的一些功能。要了解 Unity 中的 Timeline 窗口,请访问用户手册的 Timeline 部分。
Animation 窗口可用于创建各个动画剪辑以及查看导入的动画剪辑。动画剪辑存储单个游戏对象或单个游戏对象层级视图的动画。Animation 窗口可用于为游戏中的独立对象(例如摆动的钟摆、滑动的门或旋转的硬币)设置动画。Animation 窗口一次只能显示一个动画剪辑。
Animation 窗口是在 Unity 4.0 版中添加的。Animation 窗口是比 Timeline 窗口更旧的功能。Animation 窗口提供了一种创建动画剪辑和为单个游戏对象设置动画的简单方法,而在其中创建的剪辑可以用 Animator Controller 进行组合和混合。但是,要创建涉及许多不同游戏对象的更复杂序列,应使用 Timeline 窗口(见上文)。
Animation 窗口的用户界面中有一个“时间轴”(标有时间刻度的水平条),但这与 Timeline 窗口是分开的。
要了解 Unity 中的 Animation 窗口,请访问用户手册的 Animation 部分。