Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by killer-zog · Jul 04, 2013 at 10:07 PM · guichangesplash screen

GUI depth change!!

hi i have a script for scene loading in background while show a full screen image with a waiting video. but the problem is if the image is stretched it covers the loading video too, i want to show the loading video on the above of the image. can anyone help me out!! here is my code (c#), i just put a part of the code where the movie texture and 2d texture function with fade. if you need full code please leave a comment.

     void OnGUI()
     {        
            PlayVid.loop = true;
        PlayVid.Play();
     GUI.DrawTexture(new Rect (Screen.width - 260,Screen.height - 110,260,110), PlayVid);
 
         GUI.depth = guiDepth;
         if (splashLogo != null)
         {
             GUI.color = new Color(GUI.color.r, GUI.color.g, GUI.color.b, Mathf.Clamp01(alpha));
             GUI.DrawTexture(splashLogoPos, splashLogo);
             if (alpha > 1.0f)
             {
                 status = FadeStatus.FadeWaiting;
                 timeFadingInFinished = Time.time;
                 alpha = 1.0f;
                 if (splashType == SplashType.LoadNextLevelThenFadeOut)
                 {
                     oldCam.depth = -1000;
                     loadingNextLevel = true;
                     if ((Application.levelCount >= 1) && (levelToLoad != ""))
                     {
                         Application.LoadLevel(levelToLoad);
                     }
                 }
             }
             if (alpha < 0.0f)
             {
                 if (splashType == SplashType.FadeOutThenLoadNextLevel)
                 {
                     if ((Application.levelCount >= 1) && (levelToLoad != ""))
                     {
                         Application.LoadLevel(levelToLoad);
                     }
                 }
                 else
                 {
                     Destroy(oldCamGO); // somehow this doesn't work
                     Destroy(this);
                 }
             }
         }
     }


Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image killer-zog · Jul 04, 2013 at 10:59 PM 0
Share

hello! is there anyone?

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Quillicit · Jul 05, 2013 at 03:40 AM

Couple of things. First, GUI.depth can only be changed from another script, unless you're using an instance in this script, so I believe your GUI.depth is doing nothing. Second, the first thing to be rendered in your OnGUI will be at the greatest depth (farthest from the camera). The next thing rendered will go on top of the first. Try moving PlayVid.Play() to the end of your OnGUI and see if that works.

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image killer-zog · Jul 05, 2013 at 08:48 AM 0
Share

thnx, i almost forgot that.

avatar image Quillicit · Jul 05, 2013 at 12:26 PM 0
Share

No problem, glad I could help

avatar image sewy · Apr 21, 2017 at 06:33 PM 0
Share

was looking for this, thanks

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

17 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

JS changing gui box color 1 Answer

Load level that was previously loaded! 1 Answer

change detail in game an the sound? 3 Answers

Changing a GUI texture while hovering over an object? 2 Answers

Changing a material with a mouse click 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges