private void OnTriggerEnter(Collider other) { if (!IsInteractable || !other.CompareTag("Player")) { return; } Interaction(); OnDestroyChange?.Invoke(this); Destroy(gameObject); }
private void OnTriggerEnter(Collider other) { if (!IsInteractable || !other.CompareTag("Player")) { return; } _player = other.GetComponent <Player>(); Interaction(); if (!_isHole) { OnDestroyChange?.Invoke(this); Destroy(gameObject); } }