Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  4. Build games and experiences that can load instantly and without install. Explore the Project Tiny Preview today!
    Dismiss Notice
  5. Nominations have been announced for this years Unity Awards. Celebrate the wonderful projects made by your peers this year and get voting! Vote here!
    Dismiss Notice
  6. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  7. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Oculus Go VR App, buttons UI event/trigger not working

Discussion in 'Unity UI & TextMesh Pro' started by ClaudiaDu98, Oct 12, 2018.

  1. ClaudiaDu98

    ClaudiaDu98

    Joined:
    Sep 5, 2018
    Posts:
    6
    I've got a problem with my code where it's not executing properly. This code is supposed to automatically load the next scene after all 6 buttons have been pressed. But nothing happens even after I press all the buttons. I've included a PNG of what the app is supposed to look like. Please help me out :(

    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEngine.UI;
    3. using UnityEngine.SceneManagement;
    4.  
    5. public class finishChangeScene : MonoBehaviour
    6.     {
    7.     //When all main buttons are not active, change to next scene
    8.     public Button btn1;
    9.     public Button btn2;
    10.     public Button btn3;
    11.     public Button btn4;
    12.     public Button btn5;
    13.     public Button btn6;
    14.  
    15.  
    16.     void checkButton()
    17.     //if btn1, btn2, btn3, btn4, btn5, and btn6 are all NOT active load next scene
    18.     {
    19.         if (btn1.IsActive() == false &&
    20.             btn2.IsActive() == false &&
    21.             btn3.IsActive() == false &&
    22.             btn4.IsActive() == false &&
    23.             btn5.IsActive() == false &&
    24.             btn6.IsActive() == false)
    25.         {
    26.             loadScene();
    27.         }
    28.         else
    29.         {
    30.             ;
    31.         }
    32.  
    33.     }
    34.  
    35.     void loadScene()
    36.     {
    37.         SceneManager.LoadScene("5.StakeholderMenu");
    38.     }
    39. }
    40.  
     

    Attached Files: