Use of Unity3d NGUI (10) (UIPlay Animation to create a hidden display menu)

Source: Internet
Author: User

UIPlay Animation can be created using the Unity3d built-in Animation manager to make some hidden or

The displayed menu can also be implemented using NGUI's Tween animation.




UIPlay Animation: NGUI playback Animation component

A. Create a 2d UI in the Widget Tool.

B. Create a Panel under the UI Root to load the sub menu that needs to be played with an animation.

C. Add an Animation untiy3d component to the Panel.

D. Create an Animation clip in the Animation window, adjust it, and load it to the Panel.

E. Create a UIButton and add a UIPlay Animation component to UIButton.


Animator: animation controller, used in complex animation interfaces, similar to human skeleton Animation

Animation: Specifies the object for playing an Animation. (The ngui component of the Unity3d Animation component has been used)

State Name: Name of the animation status (code can be controlled)

Trigger condition: animation Trigger condition

Play direction: the playback direction of the animation. Forward (Forward, normal playback), Revert (reverse), and Toggle (COMPACT)

Selected object: Selected object

If disabled on start: If the video cannot be played at the beginning

If already playing: If the video is already playing, Continue and execute the code. Start From Beginning and play the video From the Beginning.

When Finished: Specifies whether to disable the activation status after the animation is played.

On Finished: Event distribution when the animation is complete


In this way, when we click UIButton, we can play the animation.


UITween

NGUI, with a lot of built-in supplementary animation content


Alpha, transparency

Color, Color gradient

Width: the Width of the object.

Height, object Height

Position, Object Location change

Rotation, rotating object attributes

Scale, scaling Object Attributes

Transform, location change

Volume, whether to play the sound

Field of View: Field of View

Orthographic Size, orthogonal Size


Use of Tween animation

A. Add the Tween component to the object to be added, and add the UIPlay Tween component to the event where an animation is to be played.


UIPlay Tween:

Tween Target: the object that triggers the Tween animation.

Include Children: includes all components under the parent component

Tween Group: Group for playing the Tween animation

Trigger condition: Trigger condition

Play direction: Playing direction, Toggle, can be used to Play

If target is disabled: If the target is not activated

If already playing: If playing

When finished: whether to set to inactivable When the animation is complete

On Finished: Event distribution when the animation is complete


Tip: the animation can also be added to the light to produce different colors, with the UI



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.