当前位置:网站首页>Unity animation day05

Unity animation day05

2022-07-04 15:28:00 @Night Charm

Commonly used API function :

bool isPlay = animation.isPlaying;

bool isPlay = animation.IsPlaying(" Animation name ");

animation.Play(" Animation name ");

animation.PlayQueued(" Animation name ");

animation.CrossFade(" Animation name ");

animation[" Animation name "].speed = 5;

animation[" Animation name "].wrapMode = WrapMode.PingPong;

animation[" Animation name "].length;

animation[" Animation name "].time;

Animation View:

1、 Animation view allows you to create and modify animation clips directly (Animation Clips)

2、 Show animation view :window -- Animation

Create animation clips :

1、 Add... To an object Animation Components

2、 Create clips in the animation view

Record animation clips :

1、 Recording steps :

  • Click the record button , Start recording animation

  • Add key Add Property, Select the component type

  • Select keys , Adjust the time point

  • stay Scene or Inspector Panel settings properties

  • Click the record button , End recording animation

2、 The properties of any component and material can be animated , Even public variables of custom script components .

Timeline :

1、 You can preview or modify animation clips by clicking anywhere on the timeline

2、 The number is displayed in seconds and frames ( for example :1:30 Express 1 The second and 30 frame )

3、 Use the buttons to jump to the previous or next keyframe , You can also type a specific number to jump directly to the frame .

Animation Component properties :

  • Animation Animation: The current animation

  • Animation list Animations: A list of animations that can be accessed from scripts

  • Auto play Play Automatically: The animation that plays automatically when you start the game

Animation clip attributes :

  • Package mode Wrap Mode: How to deal with the animation .

            -- Default Default, Use the processing methods in animation clips

            -- Play it once Once, Stop when the playback ends ;

            -- Loop Playback Loop, Play again after the end ;

            -- Ping Pong play PingPong, Play backward after the end ;

            -- Fixed permanent Clamp Forever, Play the last frame forever after the end ;

原网站

版权声明
本文为[@Night Charm]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/185/202207041413410647.html