Exemple #1
0
 protected override void Init()
 {
     _instance   = this;
     _tower1Pool = new GenericPool <BaseTower>(GetTowerPrefab(TowerType.Tower1), 5);
     _tower2Pool = new GenericPool <BaseTower>(GetTowerPrefab(TowerType.Tower2), 5);
     _tower3Pool = new GenericPool <BaseTower>(GetTowerPrefab(TowerType.Tower3), 5);
 }
Exemple #2
0
        public void BuildTower(TowerData towerData)
        {
            collider.enabled = false;

            _tower                        = TowersController.GetTowerToBuild(towerData.Type);
            _towerTransform               = _tower.transform;
            _towerTransform.parent        = _buildSpot;
            _towerTransform.localPosition = Vector3.zero;
            _towerTransform.localScale    = Vector3.one;
            _tower.Init(towerData.FireSpeed, towerData.FireDamage, towerData.FireDistance);
            GamePanel.Hide();
        }
Exemple #3
0
        private void Start()
        {
            _towerData = TowersController.GetTowerData(_towerType);

            _infoLabel.text = string.Format(InfoString, _towerData.FireSpeed, _towerData.FireDamage, _towerData.FireDistance);
        }