Search Unity

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

Discussion in 'UGUI & 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: