【Animation】1. Animation view

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 > Animationor use the shortcut key Ctrl+6

insert image description here

  • Opened Animation 视图as follows:

insert image description here

2. Create animation clips

Click to visit the official website to create a new animation clip

  1. Select the object you want to animate, and you can Animation 视图create an animation clip in

insert image description here

  1. After creating the first animation clip, there will be three more things

insert image description here

insert image description here

  1. At this point you can Animation 视图create 关键帧动画or录制动画
    1. 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
    2. 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

insert image description here

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

insert image description here

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.

insert image description here

●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.

insert image description here

6. Using animation events

Click to visit the official website to use animation events

  1. Click Add eventthe button to add animation events , select and press Delto delete

insert image description here

  1. Select 事件标记to Inspector 面板configure the callback

insert image description here

  1. 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}");
}
  1. Select the script you just wrote and configure the parameters

insert image description here

  1. The running game animation plays normally, and animation events are triggered normally

insert image description here

Guess you like

Origin blog.csdn.net/qq_30769437/article/details/130452574