// Update is called once per frame void Update() { spawnTimer -= Time.deltaTime; if (spawnTimer <= 0) { destroyTimer -= Time.deltaTime; if (canExplode) { destruction.Explosion((int)transform.position.x, (int)transform.position.y, 100); } if (destroyTimer <= 0) { Destroy(gameObject); } } }
// Update is called once per frame void Update() { //makes dynamite leave a hole and delete itself spawnTimer -= Time.deltaTime; if (spawnTimer <= 0) { destroyTimer -= Time.deltaTime; if (canExplode) { destruction.Explosion((int)transform.position.x, (int)transform.position.y, 100); } if (destroyTimer <= 0) { Destroy(gameObject); } } }