public void NextTurn() { highlights.ClearAllTiles(); roundState = mapRound.moving; currentTurn.EndTurn(); AdvanceQueue(); if (currentTurn == attacker) { turn.text = "Defender's Turn"; } else { turn.text = "Attacker's Turn"; } moving = null; if (currentTurn != aiArmy) { message.text = "Move a unit or press \"spacebar\" to skip your turn"; } currentTurn.BeginTurn(); if (currentTurn == aiArmy) { Invoke("AIsTurn", 1f); } }
public void StartBattle() { Destroy(gameObject.GetComponent <SetUnitController>()); gameObject.AddComponent <TClickDetector>(); attacker.OnTacticalBattleStart(); defender.OnTacticalBattleStart(); //currentTurn = attacker; roundState = mapRound.moving; moving = null; BuildQueue(); DisplayQueue(); currentTurn = unitQueue[0].army; unitQueue[0].army.activeTroops.Add(unitQueue[0]); unitQueue[0].army.inactiveTroops.Remove(unitQueue[0]); unitQueue[0].ColorOn(true); currentTurn.BeginTurn(); if (currentTurn == attacker) { turn.text = "Defender's Turn"; } else { turn.text = "Attacker's Turn"; } message.text = "Move a unit or press \"spacebar\" to skip your turn"; if (unitQueue[0].army == aiArmy) { Invoke("AIsTurn", 1f); } }