Exemplo n.º 1
0
 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);
        }
Exemplo n.º 3
0
    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;
        }
    }
Exemplo n.º 4
0
    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);
    }
Exemplo n.º 5
0
    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);
    }
Exemplo n.º 6
0
 void Start()
 {
     towerSettings = GameObject.Find("TowerSettings").GetComponent <TowerSettings>();
 }
 public DefaultTowerUpgrader(TowerSettings upgradeSettings)
 {
     _upgradeSettings = upgradeSettings;
 }
Exemplo n.º 8
0
 public MainTowerDescription(TowerSettings settings) : base(settings)
 {
 }
Exemplo n.º 9
0
 protected void AwakeTower()
 {
     uiManager     = GameObject.Find("UIManager").GetComponent <UIManager>();
     towerSettings = GameObject.Find("TowerSettings").GetComponent <TowerSettings>();
     InitializeTowerRange();
 }
 public ActualTowerDescription(TowerSettings settings) : base(settings)
 {
 }