Ejemplo n.º 1
0
    private List <AIDecisionCA> PrepareToTrain()
    {
        var prefabs = _unitSpawner.GetUnitPrefabs();
        List <AIDecisionCA> decisions = new List <AIDecisionCA>();
        int rndTier = UnityEngine.Random.Range(0, 5); // inclusive with int

        var trainCost = prefabs[rndTier].GetUnitData(
            _unitSpawner.GetCurrentUnitTiers()[rndTier]).TrainCost;

        if (_goldController.GetBalance() > trainCost)
        {
            decisions.Add(new AIDecisionCA((UnitType)rndTier, 0, true));
        }
        return(decisions);
    }