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 /
avatar image
0
Question by nubhokage1991 · Dec 09, 2017 at 10:51 AM · uiunity5vuforiapanel

How to display new panel replacing the first one

I have created an application using unity3d and vuforia sdk. Whenever an image target is found a panel containing a number of button and information related to the image target can be viewed. I had been successful in displaying the information of the first image target, when I add the next image target the same information displays and I found a script to identify which information to display to said image target and it works perfectly fine. Now the next problem that I encounter is when I pressed the button of the Main Panel it displays the Info Panel which is the information is written however the main panel can still be seen behind the info panel. I've tried to set the SetActive(false) function of the game object but still doesn't work. Hoping someone can help me understand the problem, I know that it may be because of the Update() function but i don't know how to implement the change the changes..

Here's the code: NOTE: missionPanel is the Info Panel and btnPanel is the Main Panel

 //This function is triggered when the Mission button is pressed and calls a new panel that displays the information
 public void missionShow()
         {
             btnPanel.gameObject.SetActive (false);
             txtPanel.SetActive (false);
             missionPanel.SetActive (true);
             visionPanel.SetActive (false);
         }
 
 
 //Basically this is the one that identifies which of the 2 image target is present during runtime

         void Update()
         {
             
             StateManager sm = TrackerManager.Instance.GetStateManager();
             IEnumerable<TrackableBehaviour> tbs = sm.GetActiveTrackableBehaviours();
 
             foreach (TrackableBehaviour tb in tbs)
             {
                 string name = tb.TrackableName;
                 ImageTarget it = tb.Trackable as ImageTarget;
                 Vector2 size = it.GetSize();
 
                 Debug.Log ("Active image target:" + name + "  -size: " + size.x + ", " + size.y);
 
 
                 if (name == "HTC_Logo2") 
                 {
                     
                     btnPanel.SetActive (true);
                     txtScanning.text = "HTC Logo";
                     txtHint.text = "FOUND";
 
             }
 
 
                 if (name == "CETELogo") 
                 {
                     cetePanel.SetActive (true);
                     txtScanning.text = "CETE Logo";
                     txtHint.text = "FOUND";
                 }
             }
         }
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

· Add your reply
  • Sort: 
avatar image
0

Answer by jeck001 · Jan 22, 2018 at 12:36 PM

Hi @nubhokage1991

Write your code in OnTrackingFound in DefaultTrackableEventHandler instead of using Update function.

Comment
Add comment · 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

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

137 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

Related Questions

Unity 5: How to display bird eye view layout of a 3D scene with UI component overlay on screen? 1 Answer

Button onClick events will not be triggered 1 Answer

Is there a way to hide GUI labels when a panel is on the screen? 0 Answers

UI Elements in Screen Space Overlay obey Transform.Translate, but Elements in Screen Space Camera do not. 0 Answers

Unity 5 GUI Buttons Won't Show When Built 0 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