Example #1
0
 public void OnSelectTurret(EmplacementTurretPurchaseButton fromButton)
 {
     SetTurretPurchased(fromButton.turretPrefab.Name);
     emplacement.ChangeTurret(fromButton.obj);
     currentTurretButton = fromButton;
     RebuildButtons();
 }
Example #2
0
    private void CreateTurretPurchaseButtons()
    {
        foreach (GameObject obj in purchaseableTurrets)
        {
            GameObject newButton = Instantiate(turretButtonPrefab, turretButtonParent);
            EmplacementTurretPurchaseButton butt = newButton.GetComponent <EmplacementTurretPurchaseButton> ();
            butt.turretPrefab = obj.GetComponent <EmplacementTurret> ();

            FeedButtonData(butt, obj);
            butt.cost = obj.GetComponent <EmplacementTurret> ().cost;

            if (butt.obj == emplacement.turretPrefab)
            {
                currentTurretButton = butt;
                SetTurretPurchased(butt.turretPrefab.Name);
            }
        }
    }