Beispiel #1
0
 void Start()
 {
     moneyDisplay      = GameObject.FindWithTag("moneydisplay");
     showMoneyScript   = moneyDisplay.GetComponent <ShowMoney>();
     restrainScript    = GetComponent <Restraints>();
     createTowerScript = GameObject.FindWithTag("itemspanel").GetComponent <CreateTower>();
 }
Beispiel #2
0
    public void Sell()
    {
        CreateTower.OccupiedSnaps.Remove(CreateTower.OccupiedSnaps.Find(s => s == CreateTower.Snap(gameObject.transform.parent.position)));

        int Sum = 0;

        for (int i = 1; i < UpgradeCount; i++)
        {
            Sum += UpgradeCost(i);
        }
        Game.GiveMoney((TowerVars.Cost[ParentTowerIndex] + Sum) / 2);
        /// 2); // How much should towers sell for? + UPGRADE PRICE
        Destroy(gameObject.transform.parent.gameObject);
    }
Beispiel #3
0
 // Use this for initialization
 void Start()
 {
     createTower = GameObject.Find ("ImageTouch&Move").GetComponent<CreateTower> ();
 }