예제 #1
0
 public void NextScene()
 {
     if (SceneManager.GetActiveScene().name == "Main Menu" && GetMenuItems.getMenuName() == "Quit")
     {
         Application.Quit();
     }
     else if (SceneManager.GetActiveScene().name == "Options" && GetMenuItems.getMenuName() == "Main Menu")
     {
         SceneManager.LoadScene(GetMenuItems.getMenuName());
     }
     else if (SceneManager.GetActiveScene().name == "Main Menu" && GetMenuItems.getMenuName() == "Options")
     {
         SceneManager.LoadScene(GetMenuItems.getMenuName());
     }
     //this sends you to level selection from the main menu
     else if (SceneManager.GetActiveScene().name == "Main Menu")
     {
         SceneManager.LoadScene("Level Selection");
     }
     //this sends you to character selection from level selection
     else if (SceneManager.GetActiveScene().name == "Level Selection")
     {
         SceneManager.LoadScene("Character Selection");
     }
     //this sends you from character selection to game
     else if (SceneManager.GetActiveScene().name == "Character Selection")
     {
         Debug.Log(">" + GetMenuItems.getLevelName());
         SceneManager.LoadScene(GetMenuItems.getLevelName());
     }
 }
예제 #2
0
 private void FillMenuItems()
 {
     if (GetMenuItems != null)
     {
         List <MenuItem> items = GetMenuItems.GetInvocationListTyped().Select(d => d(this)).NotNull().ToList();
         menu.Items.Clear();
         foreach (MenuItem mi in items)
         {
             menu.Items.Add(mi);
         }
     }
 }
예제 #3
0
 public void setMenuNameToQuit()
 {
     GetMenuItems.setMenuName("Quit");
 }
예제 #4
0
 public void setMenuNameToMainMenu()
 {
     GetMenuItems.setMenuName("Main Menu");
 }
예제 #5
0
 public void setMenuNameToOptions()
 {
     GetMenuItems.setMenuName("Options");
 }
예제 #6
0
 public void setLevelNameToBoat()
 {
     GetMenuItems.setLevelName("Boat_Level");
 }
예제 #7
0
 public void setLevelNameToLava()
 {
     GetMenuItems.setLevelName("Lava_Level");
 }