private void OnCollisionEnter2D(Collision2D collision) { if (collision.gameObject.CompareTag("Player")) { Destroy(this.gameObject); UIScript.ChangeTime(timeLoss); } }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.CompareTag("Player")) { UIScript.ChangeTime((float)value); Destroy(this.gameObject); } }
private void Explode() { timer += Time.deltaTime; if (timer >= explode) { timer = 0.0f; Destroy(this.gameObject); UIScript.ChangeTime(timeLoss); } }