Unity in the implementation of three logo images for 3 seconds of the looming after each other to switch logo image

Source: Internet
Author: User

    PrivateList<sprite>storetexture;  Public voidStart () {storetexture=NewList<sprite>();        Storetexture.clear (); //load the picture and store it in the listSprite Texture1 = resources.load<sprite> ("Textures/one");        Storetexture.add (Texture1); Sprite Texture2= Resources.load<sprite> ("Textures/two");        Storetexture.add (Texture2); Sprite Texture3= Resources.load<sprite> ("TEXTURES/3");        Storetexture.add (Texture3); //traverse the list object and print out the name        foreach(varKkinchstoretexture)        {Debug.logerror (kk.name); }    }    Private floatTimer =0; Private floatValue =3;  Public voidUpdate () {//Logo1 change from transparent to opaque state        if(Logoswtich = =logoswtich.start) {Timer+ = Time.deltatime/value; Logo. Getcomponent<Image> (). color =NewColor (1,1,1, Timer); if(Timer >=1) {Logoswtich=Logoswtich.deletelogo1alpha; }        }        //Logo1 from opaque to Transparent        if(Logoswtich = =logoswtich.deletelogo1alpha) {Timer-= Time.deltatime/value; Logo. Getcomponent<Image> (). color =NewColor (1,1,1, Timer); if(Timer <=0) {Logoswtich=Logoswtich.changelogo2; }        }        //Replace the Logo1 with the Logo2        if(Logoswtich = =logoswtich.changelogo2) {logo. Getcomponent<Image> (). Sprite = storetexture[1]; Logoswtich=Logoswtich.addlogo2alpha; }        //Logo2 change from transparent to opaque state        if(Logoswtich = =logoswtich.addlogo2alpha) {Timer+ = Time.deltatime/value; Logo. Getcomponent<Image> (). color =NewColor (1,1,1, Timer); if(Timer >=1) {Logoswtich=Logoswtich.deletelogo2alpha; }        }        //Logo1 from opaque to Transparent        if(Logoswtich = =logoswtich.deletelogo2alpha) {Timer-= Time.deltatime/value; Logo. Getcomponent<Image> (). color =NewColor (1,1,1, Timer); if(Timer <=0) {Logoswtich=Logoswtich.changelogo3; }        }        //Replace the Logo2 with the Logo3        if(Logoswtich = =Logoswtich.changelogo3) {logo. Getcomponent<Image> (). Sprite = storetexture[2]; Logoswtich=Logoswtich.addlogo3alpha; }        //Logo3 change from transparent to opaque state        if(Logoswtich = =logoswtich.addlogo3alpha) {Timer+ = Time.deltatime/value; Logo. Getcomponent<Image> (). color =NewColor (1,1,1, Timer); if(Timer >=1) {Logoswtich=Logoswtich.deletelogo3alph; }        }        //Logo3 from opaque to Transparent        if(Logoswtich = =Logoswtich.deletelogo3alph) {Timer-= Time.deltatime/value; Logo. Getcomponent<Image> (). color =NewColor (1,1,1, Timer); if(Timer <=0) {Logoswtich=Logoswtich.changelogo1; }        }        //Replace the Logo3 with the Logo1        if(Logoswtich = =logoswtich.changelogo1) {logo. Getcomponent<Image> (). Sprite = storetexture[0]; Logoswtich=Logoswtich.start; }} Logoswtich Logoswtich=Logoswtich.start; //logo picture Toggle Status     Public enumLogoswtich {Start, Deletelogo1alpha, ChangeLogo2, Addlogo2alpha, Deletelogo2al PHA, ChangeLogo3, Addlogo3alpha, Deletelogo3alph, ChangeLogo1, End}

Replace the logo image property with the image component in unity as follows:
1 Sprite used to render the image.

2. Overridesprite sets the overlay sprite for rendering, and setting to NULL restores the default srpite.

Replacing picture properties with rawimage components in unity is texture (rawimage texture)

Unity in the implementation of three logo images for 3 seconds of the looming after each other to switch logo image

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.