Example #1
0
    private IEnumerator StartBattle()
    {
        battlePanel.SetActive(true);
        battleText.text = "Prepare to battle...";
        yield return(new WaitUntil(() => enemyScript.isReadyToBattle == true));


        shieldUsed          = playerDataSaver.GetShieldUsed();
        shieldAvailable     = playerDataSaver.GetRecycleCollected() - shieldUsed;
        projectileUsed      = playerDataSaver.GetProjectileUsed();
        projectileAvailable = playerDataSaver.GetWasteCollected() - projectileUsed;
        attackAmount.text   = projectileAvailable.ToString();
        shieldAmount.text   = shieldAvailable.ToString();

        currentState = BattleState.PlayerTurn;
        PlayerTurn();
    }