public void replay() { if (MenuController.on_reset_event != null) { MenuController.on_reset_event(this, EventArgs.Empty); } CharacterBlock.selected_block_stack.Clear(); CharacterBlock.last_clicked_on_character = null; panel.SetActive(false); vowel_panel.SetActive(false); current_word.SetActive(false); pc.Start(); board_creator.Start(); gm.Start(); tc.Start(); sc.Start(); }
public void Reset() { player.gameObject.SetActive(false); // Destroy Blocks with the object BlockController blocksArray = FindObjectsOfType <BlockController>(); for (int i = 0; i < blocksArray.Length; i++) { Destroy(blocksArray[i].gameObject); } // Destroy Gates gatesArray = FindObjectsOfType <Gate>(); for (int i = 0; i < gatesArray.Length; i++) { Destroy(gatesArray[i].gameObject); } firstBlock.transform.position = BLOCK_START_POSITION; player.transform.position = PLAYER_START_POSITION; scoreController.Start(); obstacleController.Start(); player.ResetPlayer(); player.gameObject.SetActive(true); deathMenu.gameObject.SetActive(false); }