// Use this for initialization void Start() { hp.text = "HP: " + player.getHp(); setbar(); }
// Update is called once per frame void Update() { switch (currentState) { case (BattleStates.BEGIN): //currentState = (BattleStates)(((int)currentState + 1)%5); Player_turn = true; currentState = BattleStates.PLAYERCHOICE; Debug.Log("begin"); break; case (BattleStates.PLAYERCHOICE): Debug.Log("player"); break; case (BattleStates.ENEMYCHOICE): Player.TakeDamage(10); if (Player.getHp() <= 0) { currentState = BattleStates.DEFEAT; } else if (Enemy.getHp() <= 0) { currentState = BattleStates.VICTORY; } else { currentState = BattleStates.BEGIN; } Debug.Log("enemy"); break; case (BattleStates.DEFEAT): StateOfResult.text = "#99 VICTORYN'T ROYALE"; FinnishGame(); Debug.Log("defeat"); break; case (BattleStates.VICTORY): StateOfResult.text = "#1 VICTORY ROYALE"; FinnishGame(); Debug.Log("wictory"); break; } }