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

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

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