private void Awake()
 {
     towerBehaviour           = GetComponent <TowerBehaviour>();
     Damage                   = settings.damage;
     SpeedAttack              = settings.attackSpeed;
     damageCoeffIncrease      = settings.damageCoeffIncrease;
     speedAttackCoeffIncrease = settings.speedAttackCoefIncrease;
     Cost = settings.cost;
     costCoeffIncrease        = settings.costCoeffIncrease;
     towerBehaviour.OnUpdate += Updated;
 }
        private void Updated(TowerBehaviour tower)
        {
            if (goldComponent.ReturnGold < tower.Cost)
            {
                return;
            }
            goldComponent.Buy(tower.Cost);
            var cost        = tower.Cost * costCoeffIncrease;
            var damage      = tower.Damage * damageCoeffIncrease;
            var speedAttack = tower.SpeedAttack * speedAttackCoeffIncrease;

            tower.UpParametrs(1, damage, speedAttack, cost);
        }
Beispiel #3
0
 private void Start() => tower = GetComponentInParent <TowerBehaviour>();