public void SetUp(EnemiesManager enemiesManager, TowerSettings settings, GoldManager goldManager, UIManager uiManager) { this.enemiesManager = enemiesManager; this.settings = settings; this.goldManager = goldManager; this.uiManager = uiManager; }
public static TowerSettings GetTowerSettingsByType(Enumerators.TowerType towerType) { TowerSettings[] towerSettings = GameClient.Get <IDataManager>().GetScriptableObject <TowerSettingsData>().towerSettings; TowerSettings towerData = towerSettings.FirstOrDefault(x => x.towerType == towerType); if (towerData == null) { Debug.LogError("No TowerSettings for tower with type - " + towerType); } return(towerData); }
public void BuyTower(TowerSettings tower) { AudioManager.PlayUIButtonAudio(); float cost = tower.BuildPrice; if (coins >= cost) { coins -= cost; coinsText.text = "Coins " + coins; } else { towerPanel.GetComponent <TowerSpawner>().canSpawn = false; } }
private void Start() { TowerSettings towerSettings = GameObject.FindObjectOfType <TowerSettings>(); selectionPanel = GameObject.Find("SelectedOption").GetComponent <CanvasGroup>(); upgradePanel = GameObject.Find("UpgradeOption").GetComponent <CanvasGroup>(); MachineGunTowerScriptableObject mgso = towerSettings.machineGunTowerScriptableObjects[0]; MissileLauncherTowerScriptableObject mlso = towerSettings.missileLauncherTowerScriptableObjects[0]; FreezerTowerScriptableObject fso = towerSettings.freezerTowerScriptableObjects[0]; DisplayTowerPrices(mgso.price, mlso.price, fso.price); DisplayTowerDPS(mgso.damage, mgso.fireRate, mlso.damage, mlso.fireRate); HideShowTowerInformation(false); }
public void Build(TowerSettings settings) { GameObject NewTower = new GameObject(); Vector3 pos = Place.transform.transform.position; pos.z++; NewTower.transform.position = pos; NewTower.name = "Tower"; NewTower.AddComponent <CircleCollider2D>(); SpriteRenderer spriteRenderer = NewTower.AddComponent <SpriteRenderer>(); spriteRenderer.sprite = settings.Sprite; spriteRenderer.sortingOrder = 1; NewTower.AddComponent <TowerShoot>().Settings = settings; GetGameController._GetGameController.Balance -= settings.Price; GetGameController._GetGameController.UpdateUI(); Place.GetComponent <TowerPlace>().Tower = NewTower; gameObject.SetActive(false); }
void Start() { towerSettings = GameObject.Find("TowerSettings").GetComponent <TowerSettings>(); }
public DefaultTowerUpgrader(TowerSettings upgradeSettings) { _upgradeSettings = upgradeSettings; }
public MainTowerDescription(TowerSettings settings) : base(settings) { }
protected void AwakeTower() { uiManager = GameObject.Find("UIManager").GetComponent <UIManager>(); towerSettings = GameObject.Find("TowerSettings").GetComponent <TowerSettings>(); InitializeTowerRange(); }
public ActualTowerDescription(TowerSettings settings) : base(settings) { }