Ejemplo n.º 1
0
 private void OnEnable()
 {
     foreach (var child in FindObjectsOfType <Transform>())
     {
         if (child.name.Contains("Main_Canvas"))
         {
             MainCanvas          = child.GetComponent <Canvas>().gameObject;
             OpenStartGameButton = MainCanvas.transform.GetChild(1).GetChild(0).GetComponent <Button>().gameObject;
         }
         if (child.name.Contains("Options_Canvas"))
         {
             OptionsCanvas     = child.GetComponent <Canvas>().gameObject;
             BackButtonOptions = OptionsCanvas.GetComponentInChildren <Button>().gameObject;
             OptionsCanvas.SetActive(false);
         }
         if (child.name.Contains("Controls_Canvas"))
         {
             ControlsCanvas     = child.GetComponent <Canvas>().gameObject;
             BackButtonControls = ControlsCanvas.GetComponentInChildren <Button>().gameObject;
             ControlsCanvas.SetActive(false);
         }
         if (child.name.Contains("Start_Game_Canvas"))
         {
             StartLocalGameCanvas = child.GetComponent <Canvas>().gameObject;
             StartGameButton      = StartLocalGameCanvas.transform.GetChild(2).GetChild(3).GetComponent <Button>().gameObject;
             StartLocalGameCanvas.SetActive(false);
         }
     }
 }
Ejemplo n.º 2
0
 public void StartLocalGame()
 {
     SwitchCanvas(StartLocalGameCanvas.GetComponent <Canvas>());
     SetSelected();
 }