Unity3d_ (game) same card 01_ Start screen interface

Source: Internet
Author: User

Estimated 8.22 days before completion ~

Splash screen, main Menu interface, check-off interface, game interface,

Same card 01_ start screen portal

Start Screen interface

5s after start scene jumps to MainMenu scene

(0.5s blinks once!) )

Click the start scene (press any key) to jump from the start scene to the MainMenu scene

usingSystem.Collections;usingSystem.Collections.Generic;usingUnityengine;usingunityengine.scenemanagement; Public classScene_start:monobehaviour {float_timer;    Gameobject Anykeyobj; //Use this for initialization    voidStart () {_timer=0; Anykeyobj= Gameobject.find ("Anykeytxt"); }        //Update is called once per frame    voidUpdate () {_timer+=Time.deltatime; if(_timer%0.5f>0.25f) {anykeyobj.setactive (true); }        Else{anykeyobj.setactive (false); }        if(_timer>5||input.anykeydown) {gotomainmenu (); }    }        voidGotomainmenu () {Scenemanager.loadscene ("MainMenu"); }}
Scene_start.cs

Implementation process

Create four scenes and save them in the project

Create a game screen resolution

Canvas resolution and multi-screen adaptation

Add background (image), logo (image), name (text), Anykeytxt (TXT)

Create an empty object to mount the script

usingSystem.Collections;usingSystem.Collections.Generic;usingUnityengine;usingunityengine.scenemanagement; Public classScene_start:monobehaviour {float_timer;    Gameobject Anykeyobj; //Use this for initialization    voidStart () {_timer=0; Anykeyobj= Gameobject.find ("Anykeytxt"); }        //Update is called once per frame    voidUpdate () {_timer+=Time.deltatime; if(_timer%0.5f>0.25f) {anykeyobj.setactive (true); }        Else{anykeyobj.setactive (false); }        if(_timer>5||input.anykeydown) {//Press any key to jump directly to the main menu sceneGotomainmenu (); }    }    voidGotomainmenu () {Scenemanager.loadscene ("MainMenu"); }}
Scene_start.cs

Anykeytxt text Flicker Effect

Text Status visible

Anykeyobj.setactive (true);

  

Text state is not visible

Anykeyobj.setactive (false);

Add text flashes

        if 0.5f 0.25f )        {            anykeyobj.setactive (true);        }         Else         {            anykeyobj.setactive (false);        }

After 5s or any key press, jump directly to the MainMenu scene

        if (_timer>5| | Input.anykeydown)        {            gotomainmenu ();        }         void Gotomainmenu ()        {            Scenemanager.loadscene ("MainMenu");        }

Unity3d_ (game) same card 01_ Start screen interface

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.