public void OnTriggerEnter2D(collider2D other) { if (other.GameObject.CompareTag("enemy")) { Destroy(this.GameObject); } }
private void OnTriggerExit2D(collider2D collision) { if (collision.gameObject.CompareTag("Player")) { IsInRange = false; collision.GetComponent <PlayerManager>().DeNotifyPlayer(); Debug.Log("Player now not in range"); } }