Dotween application in the legend of the Furnace Stone, from the start interface to the character selection interface animation switch

Source: Internet
Author: User

Animation playback steps are preceded by ...

and add it in the MoveStart script.

Public Dotweenanimation Hero_selectpage;
public bool Iscanshowselectrole = false;//Whether to enter the role selection interface

Public Dotweenanimation Welcompage;
public bool iswelcomfinished = FALSE;

Drag and drop assignments on the Inspector panel

"Welcom page" is the logo of the start screen

"Hero_selectpage" selects the panel for the entire role

Check out the AutoPlay on the dotweenanimation.

Then add in the animation end method of the Code

Welcompage.doplay ();

Animations that play logo bounce after the end of the animation

Or add a flag-bit method to the script that appears in the role panel

 Public void onwelcompagefinished ()    {        true;    }

Add this method into the OnComplete method in the Welcompage dotweenanimation

This enables the "switch" of the character selection screen after the logo animation

Finally, add the control code in update:

if (Iscanshowselectrole&&input.getmousebuttondown (0))        {            hero_selectpage.doplayforward ();        }

It realizes the method of jumping out of the role selection interface.

Overall code:

1 usingUnityengine;2 usingSystem.Collections;3 usingDG. tweening;4 5  Public classMovestart:monobehaviour {6      Publicmovietexture movtexture;7      Public BOOLIsdrawmov =true;8      Public BOOLIsshowmessage =false;9     Ten      Publicdotweenanimation hero_selectpage; One      Public BOOLIscanshowselectrole =false;//whether to enter the role selection interface A  -      Publicdotweenanimation welcompage; -      Public BOOLiswelcomfinished =false; the  -  -  -  +     -     voidStart () +     { A         atMovtexture.loop =false; - Movtexture.play (); -          -     } -      -     //Update is called once per frame in     voidUpdate () { -         if(Isdrawmov) to         { +             if(Input. Getmousebuttondown (0) && isshowmessage==false) -             { theIsshowmessage =true; *             } $             Else if(Input.getmousebuttondown (0) &&isshowmessage)Panax Notoginseng             { - Spotmovie (); the                  +                     A                      the                  +  -}//Stop playback after manual intervention $         } $         if(isdrawmov!=movtexture.isplaying) -         { - Spotmovie (); the  -}//Auto Play finished stop playbackWuyi  the         if(Iscanshowselectrole&&input.getmousebuttondown (0)) -         { Wu Hero_selectpage.doplayforward (); -         } About         $  -         -  -  A         +     } the  -     voidOngui () $     { the         if(Isdrawmov) the         { theGui. Drawtexture (NewRect (0,0, Screen.width, screen.height), movtexture); the             if(isshowmessage) -             { inGui. Label (NewRect (screen.width/2- -, screen.height/2, $, +),"Click the left mouse button to exit the title"); the             } the         } About         the          the     } the  +     Private voidSpotmovie () -     { the movtexture.stop ();BayiIsdrawmov =false; the Welcompage.doplay (); the     } -  -      Public voidonwelcompagefinished () the     { the  theIscanshowselectrole =true; the     } -}

Dotween application in the legend of the Furnace Stone, from the start interface to the character selection interface animation switch

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.