Exemplo n.º 1
0
 void Start()
 {
     // set start values of the menu members
     menu.SetActive(true);
     pause_btn.SetActive(true);
     play_btn.SetActive(false);
     inside_menu.SetActive(false);
     the_state     = current_screen.menu;
     pause_or_play = pause_play_state.play;
     dead_menu.SetActive(false);
 }
Exemplo n.º 2
0
 // play function called from play button to start the game
 public void play(bool plays)
 {
     if (plays)
     {
         menu.SetActive(false);
         inside_menu.SetActive(true);
         the_state = current_screen.game;
         Transform level = (Transform)Instantiate(lvl, lvl_place.position, Quaternion.identity);
         cur_lvl = level.transform.gameObject;
     }
 }
Exemplo n.º 3
0
 // called from escape button & back to menu to get the player back to the main menu
 public void back_to_menu()
 {
     Destroy(cur_lvl);
     inside_menu.SetActive(false);
     menu.SetActive(true);
     the_state      = current_screen.menu;
     Time.timeScale = 1;
     play_btn.SetActive(false);
     pause_btn.SetActive(true);
     pause_or_play = pause_play_state.play;
     dead_menu.SetActive(false);
 }