IEnumerator PlayerAtk1()
    {
        if (State == BattleState.PLAYERTURN)
        {
            atk1 = Random.Range(atk1Min, atk1Max);
            bool isDead = EnemyUnit.TakeDamage(atk1);
            //ACHIEVED MULTIPLE SOUNDS ON ONE SCRIPT!!
            GetComponent <AudioSource>().clip = Hit;
            GetComponent <AudioSource>().Play();
            enemyHUD.HP.text = EnemyUnit.currentHP.ToString();
            State            = BattleState.ENEMYTURN;
            //CombatLog.text += atk1.ToString() + "dmg dealt to enemy." + "\n";
            //CombatLog.color = Color.blue;
            UpdateCombatLog(atk1.ToString() + "dmg dealt to enemy.", Color.blue);
            EHalo.SetActive(false);
            PHalo.SetActive(true);
            yield return(new WaitForSeconds(2));

            if (isDead)
            {
                State = BattleState.WON;
                EHalo.SetActive(false);
                PHalo.SetActive(false);
                EndBattle();
            }

            else
            {
                StartCoroutine(EnemyTurn());
            }
        }
    }
    IEnumerator SetupBattle()
    {
        PlayerUnit = playerPrefab.GetComponent <Stats>();
        EnemyUnit  = enemyPrefab.GetComponent <Stats>();
        playerHUD.SetHUD(PlayerUnit);
        enemyHUD.SetHUD(EnemyUnit);
        EHalo.SetActive(false);
        yield return(new WaitForSeconds(0));

        State = BattleState.PLAYERTURN;
        PlayerTurn();
    }
 public void OnHeal()
 {
     if (State != BattleState.PLAYERTURN)
     {
         return;
     }
     else
     {
         StartCoroutine(PlayerHeal());
         EHalo.SetActive(true);
         PHalo.SetActive(false);
     }
 }
    void EndBattle()
    {
        if (State == BattleState.WON)
        {
            //winBox.SetActive(true);
            //WON.SetActive(true);
            wonEnd.SetActive(true);
            enemyPrefab.SetActive(false);
            EHalo.SetActive(false);
            PHalo.SetActive(false);
        }

        else if (State == BattleState.LOST)
        {
            //loseBox.SetActive(true);
            playerPrefab.SetActive(false);
            //LOST.SetActive(true);
            loseEnd.SetActive(true);
            EHalo.SetActive(false);
            PHalo.SetActive(false);
        }
    }
 void PlayerTurn()
 {
     //Choose an action
     EHalo.SetActive(false);
     PHalo.SetActive(true);
 }