IEnumerator FleeTime() { results = battleResults.Flee; yield return(new WaitForSeconds(3f)); results = battleResults.Normal; }
private void OnTriggerEnter(Collider other) { if (other.tag == "NextRoom") { CollisionHandeler col = other.gameObject.GetComponent <CollisionHandeler>(); GameManager.instance.nextPlayerPosition = col.spawnPoint.transform.position; GameManager.instance.SceneToLoad = col.sceneToLoad; GameManager.instance.LoadNextScene(); } if (other.tag == "EnemyEncounter") { if (results == battleResults.Victory) { other.GetComponent <CollectRewards>().CollectReward(); results = battleResults.Normal; } else { pbi.inBattle = true; EncounterHandeler eco = other.gameObject.GetComponent <EncounterHandeler>(); GameManager.instance.curEncounter = eco.encounterNumber; GameManager.instance.nextPlayerPosition = eco.spawnPoint.transform.position; GameManager.instance.BattleEncounter(); } } }