Search Unity

  1. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    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. Let us know a bit about your interests, and if you'd like to become more directly involved. Take our survey!
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  5. Want to see the most recent patch releases? Take a peek at the patch release page.
    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: