protected virtual void Update() { // //Debug.Log(numberOfPlayers); //Number of players is decreased by the player scripts if (numberOfPlayers <= 0 && allPlayersAdded == false) { allPlayersAdded = true; addEnemies = true; battleHasEnded = false; for (int i = 0; i < 5; i++) { enemySpawner.AddPos(enemyPos[i], i); } enemySpawner.SpawnEnemies(); } //Only start the battle when all players and enemies have been added if (allPlayersAdded && allEnemiesAdded) { //Debug.Log("Start Battle"); StartBattle(); allPlayersAdded = false; allEnemiesAdded = false; numberOfPlayers = 4; //Ready for the next battle addEnemies = false; } }
protected virtual void Start() { // //Debug.Log("BTL Start"); uiBtl = UIBTL.instance; enemySpawner = EnemySpawner.instance; expManager = ExpManager.instance; uiBtl.numberOfEnemies = numberOfEnemies = enemySpawner.numberOfEnemies; ////Debug.Log("____ " + numberOfEnemies); for (int i = 0; i < 5; i++) { enemySpawner.AddPos(enemyPos[i], i); } //Each player and enemy would have an index that stores their information //Get player stats from partystats file for (int i = 0; i < players.Length; i++) { UpdatePlayerStats(i); } }