示例#1
0
    /*IEnumerator EnemyTurn()
     * {
     *  dialogText.text = "Enemy Turn";
     *
     *  //Choose State
     *  IsEnemyChoosing = true;
     *
     *  if (scoreData.hLife<=0 & scoreData.mLife<=0) //el score es la vida de los players
     *  {
     *      states = BattleStates.Lost;
     *      EndBattle();
     *  }
     *  yield return new WaitForSeconds(2f);
     * }*/

    /* IEnumerator PlayerTurn()
     * {
     *   yield return new WaitForSeconds(2f);
     *
     *   if (states != BattleStates.PlayerTurn)
     *            {
     *                yield break;
     *            }
     *   dialogText.text = "Choose a Player";
     *
     *   //Choose a Player and Attack
     *
     *   IsPlayerChoosing = true;
     *
     *   if (lifeBattleVirus1<=0 & lifeBattleVirus2<=0)
     *   {
     *       states = BattleStates.Won;
     *       EndBattle();
     *   }
     *
     *   yield return new WaitForSeconds(2f);
     * }*/

    void EndBattle()

    {
        if (states == BattleStates.Won)
        {
            dialogText.text = "You won the battle!";
            _characterController1.GoBackCity();
            _startLevel2.enabled = true;
        }
        else if (states == BattleStates.Lost)
        {
            dialogText.text = "You loose";
        }
    }
    void EndBattle()

    {
        if (states == BattleStates.Won)
        {
            dialogText.text = "You won the battle!";
            scoreData.xp   += 50;
            _characterController1.GoBackCity();
            _startLevel2.enabled = true;
        }
        else if (states == BattleStates.Lost)
        {
            scoreData.xp   -= 50;
            dialogText.text = "You loose";
            this.lostGame   = true;
        }
    }