示例#1
0
 void FixedUpdate()
 {
     if (allowGen && Time.time - timeOfLastGen > timeBetweenGoldGen)
     {
         baseStats.AddMoney(amountToGen);
         timeOfLastGen = Time.time;
     }
 }
    public void TakeDamage(int damage)
    {
        health -= damage;

        if (health <= 0)
        {
            baseStats.AddMoney(moneyDrop);
            Destroy(gameObject);
        }
    }
示例#3
0
    void Update()
    {
        if (selected && Input.GetMouseButtonUp(0))
        {
            GameObject tower = GameObject.FindGameObjectWithTag("Ghost");

            try {
                baseStats.AddMoney(tower.GetComponent <GhostTowerDragger> ().GetCost());
                Destroy(tower);
            } catch {
            }
        }
    }