Пример #1
0
 void selectLevel()
 {
     if (GameObject.Find("MainMenu").CompareTag("main-menu"))
     {
         var mainMenu = GameObject.Find("MainMenu").GetComponent <CanvasGroup>();
         mainMenu.alpha                  = 0;
         mainMenu.blocksRaycasts         = false;
         mainMenu.interactable           = false;
         GameObject.Find("MainMenu").tag = "Untagged";
         GameObject.Find("Panel").GetComponent <CanvasGroup>().alpha = 1;
     }
     QLevel.Initialize(index);
     _levelMenu.CloseMenu();
 }
Пример #2
0
 public void ButtonOnClickEvent()
 {
     editor.SetState(editState.Create);
     if (this.name == "Button_Rail")
     {
         editor.SwitchQubit("QRails");
     }
     else if (this.name == "Button_Turn")
     {
         editor.SwitchQubit("QTurns");
     }
     else if (this.name == "Button_Slant")
     {
         editor.SwitchQubit("QSlants");
     }
     else if (this.name == "Button_BottleNeck")
     {
         editor.SwitchQubit("QBottleNeck");
     }
     else if (this.name == "Serialize")
     {
         ResourceMenu res_menu = GameObject.Find("ResourceMenu").GetComponent <ResourceMenu>();
         res_menu.show();
         SwitchState();
     }
     else if (this.name == "Level_Menu_Button")
     {
         if (menu.getState() == 0)
         {
             if (CompareTag("main-menu"))
             {
                 var mainMenu = GameObject.Find("MainMenu").GetComponent <CanvasGroup>();
                 mainMenu.alpha          = 0;
                 mainMenu.interactable   = false;
                 mainMenu.blocksRaycasts = false;
             }
             menu.OpenMenu();
             SwitchState();
         }
         else
         {
             if (CompareTag("main-menu"))
             {
                 var mainMenu = GameObject.Find("MainMenu").GetComponent <CanvasGroup>();
                 mainMenu.alpha          = 1;
                 mainMenu.interactable   = true;
                 mainMenu.blocksRaycasts = true;
             }
             menu.CloseMenu();
             SwitchState();
         }
     }
     else if (this.name == "Reset")
     {
         editor.SetState(editState.Rest);
         Level currentLevel = GameObject.Find("Level").GetComponent <Level>();
         int   index        = currentLevel.GetIndex();
         if (index == 0)
         {
             return;
         }
         currentLevel.Initialize(index);
     }
 }