Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
This question was closed Apr 29, 2018 at 02:23 AM by Dlra for the following reason:

Other

avatar image
0
Question by Dlra · Apr 24, 2018 at 08:15 PM · androidunity 2dpanel

How to make everything inside a panel visible and on top of everything ?

"LevelCompletedPanel" is the one that I am trying to make it on top of everything when a level is finished. This panel is inactive and its children are active as default. And this is what I do on scripting :

 public static GameObject panel;
 
 private void Start()
     {
         panel = GameObject.Find("GameManager/ExtraCanvas/LevelCompletedPanel");
     }
 
 public static void LevelCompleted()
     {
         instance.StartCoroutine(LevelFinished());
     }
 
 
 public static IEnumerator LevelFinished()
     {
         yield return new WaitForSeconds(1f);
         panel.SetActive(true);
         yield return new WaitForSeconds(5f);
         panel.SetActive(false);
         GoBack();
     }
 
 public static void GoBack(){
         activeScene = SceneManager.GetActiveScene().buildIndex;
         Debug.Log ("active : " + activeScene);
         switch (activeScene) 
         {
         case 1:
             SceneManager.LoadScene(0);
             break;
         case 2:
             SceneManager.LoadScene(1);
             break;
         case 3:
             SceneManager.LoadScene(1);
             break;
         case 4:
             SceneManager.LoadScene(2);
             break;
         case 5:
             SceneManager.LoadScene(2);
             break;
         case 6:
             SceneManager.LoadScene(3);
             break;
         case 7:
             SceneManager.LoadScene(3);
             break;
         }
     }


Then I call it on another script in Update function like this :

 if (pieces.transform.childCount == 0)
             {
                 for (int i = 0; i < 1; i++)
                 {
                     gameObject.transform.position = last_position;
                     score = GameObject.Find("GameManager/ExtraCanvas/LevelCompletedPanel/EarnedPointsText").GetComponent<Text>();
                     score.text = "10 puan kazandın !";
                     _GM.AddScore(10);
                     _GM.LevelCompleted();
                 }
             }


I have more than one game, this is only one example, I call LevelCompleted() function on different places but when I build the project all I can see is background of this panel and EarnedPointsText, others are not visible. I've already changed everything's sorting layer even the particles'. I would appreciate any help. Thanks. [1]: /storage/temp/115668-screenshot-1.png

screenshot-1.png (4.3 kB)
Comment
Add comment
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

1 Reply

  • Sort: 
avatar image
0

Answer by Karsten · Apr 24, 2018 at 08:42 PM

Make sure the panel in question is the last on the bottom of the root canvas in the scene hierarchy, the first is overdrawn by all following items, so the last UI element in the canvas will be drawn over every other . "The first is the last and the last is the first" ...

Comment
Add comment · Show 4 · 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 Dlra · Apr 25, 2018 at 12:48 AM 0
Share

Thanks for your answer, unfortunately it didn't work. Panel is already at the bottom of its root canvas and I even tried SetAsLastSibling but also didn't work. I have InfoPanel and all I do is setting it active and this works. But with this LevelCompletedPanel, I get the panel but not everything inside of it.

avatar image Karsten Dlra · Apr 25, 2018 at 07:55 AM 0
Share

I see in your screenshot your root canvas is a child of another game object, what kind is your root canvas? Is it screen space or world space / camera space? You can't see Congrats and the Particle tree but EarnedPointsText is visible , do i understand that right? However , your Canvas should be on top level ,not a child of any other game object when it is Screen Space or Camera Space.

avatar image Dlra Karsten · Apr 26, 2018 at 10:29 AM 0
Share

Yes, you're right, only EarnedPointsText is visible. To be honest, I didnt know about that canvas should be on top level but I don't think this is the case because if so I couldn't have seen InfoPanel either. I have 2-3 canvases(including this one) in every scene and this one is attached to game manager. Also it is Screen Space - Camera.

Show more comments

Follow this Question

Answers Answers and Comments

174 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 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 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 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 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 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 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 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 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 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 avatar image avatar image avatar image avatar image

Related Questions

Intent Android studio class to imported Unity class(Android Class A,Button1 - Unity Scene A, Android Class A,Button2 - Unity Scene b ) 0 Answers

resolution is squished horizontal on android 0 Answers

Can't get my Unity 2D animation to play properly 1 Answer

My text don't appear in Game Window, help 1 Answer

error CS0234: The type or namespace name 'Editor' does not exist in the namespace 'Firebase.Unity' 3 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