Article directory
Click to visit the official website to use the Animation view
Animation 视图
Used for previewing and editing animated s in 游戏对象
Unity动画剪辑
.
1. Open the Animation view
- Please select
Window > Animation > Animation
or use the shortcut key Ctrl+6
- Opened
Animation 视图
as follows:
2. Create animation clips
Click to visit the official website to create a new animation clip
- Select the object you want to animate, and you can
Animation 视图
create an animation clip in
- After creating the first animation clip, there will be three more things
- At this point you can
Animation 视图
create关键帧动画
or录制动画
- The animated properties are listed on the left side of the Animation view. In new clips that have not recorded any animation, this list is empty
- When an entire GameObject Hierarchy needs to be animated in a single clip, make sure to animate on the root GameObject of the Hierarchy
Click to visit the official website to animate game objects
3. Animation timeline
On the right side of the Animation view is the timeline for the current clip. The keyframes for each animation property are shown in this timeline.
◆ The timeline view has two modes:
- Keyframe List (Dopesheet) Mode
- Curves mode
3.1. Key frame list timeline mode
The Keyframe List mode provides a more compact view of the sequence of keyframes for each property in a single horizontal track.
See the documentation on key manipulation in Dopesheet mode for more information.
3.2. Curved time axis mode
Curves mode displays a resizable graph with a view of how the value of each animated property changes over time. All selected attributes are displayed superimposed on the same graph. In this mode, there is fine control over viewing and editing of property values, and how values are interpolated between the two.
To learn more about navigating the Curve view, see the Working with Animation Curves documentation.
◆ Shortcut keys:
- Click on each property in the list and press on the keyboard Fto automatically rescale the view to fit the range of values
- Press on the keyboard Ato fit and rescale the window to show all keyframes in the clip (regardless of which frames are selected)
4. Control of playback and frame navigation
To control the playback of an animation clip , use Animation 视图
the __Playback Control__ at the top left.
●You can also use the following keyboard shortcuts to control the playback head:
- Press ,(comma) to jump to the previous frame
- Press .(period) to skip to the next frame
- Hold Alt+ ,(comma) to jump to previous keyframe
- Hold Alt+ .(period) to skip to the next keyframe
5. Lock the window
The Animation editor window can be locked so that it does not automatically switch to reflect the currently selected GameObject in the Hierarchy or Scene view.
6. Using animation events
Click to visit the official website to use animation events
- Click
Add event
the button to add animation events , select and press Delto delete
- Select
事件标记
toInspector 面板
configure the callback
- The animation event can receive a parameter, write the animation event and mount it on the animation object
public void OnAnimationEnd(int a)
{
Debug.Log($"动画播放结束!接到的参数a={a}");
}
- Select the script you just wrote and configure the parameters
- The running game animation plays normally, and animation events are triggered normally