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