IEnumerator Engage(float delay /*, GameObject enemyToSpawn*/) { yield return(new WaitForSeconds(delay)); sceneMover.LoadLevel("Battle scene"); //Instantiate(enemyToSpawn); }
//this function has to have different functionalty later on //this function will take you to the load screen public void QuittingGame() { Debug.Log("Quitting game..."); PauseMenuUI.SetActive(false); sceneMovement.LoadLevel("Title screen"); Time.timeScale = 1f; }
IEnumerator EndBattle() { if (state == BattleState.WON) { statusUpdate.text = "You won!"; PlayerStats.gold += enemyUnit.gold; PlayerStats.exp += enemyUnit.exp; yield return(new WaitForSeconds(2f)); sceneMover.LoadLevel("Overword"); } else if (state == BattleState.LOST) { statusUpdate.text = "You died"; yield return(new WaitForSeconds(2f)); sceneMover.LoadLevel("Title screen"); } }