private void OnCollisionEnter(Collision collision) { if (!this.enabled) { return; } if (filter.Match(collision.gameObject)) { collisionEnter?.Invoke(collision); } }
private void OnTriggerEnter2D(Collider2D other) { if (!this.enabled) { return; } if (filter.Match(other.gameObject)) { triggerEnter?.Invoke(other); } }
private void OnTriggerEnter2D(Collider2D other) { // Debug.Log("other.tag:" + other.tag); // Debug.Log("tagFilter.Contains(other.tag): " +tagFilter.Contains(other.tag)); if (!this.enabled) { return; } if (filter.Match(other.gameObject) && (requirePositionInbound? (triggerZone.OverlapPoint(other.transform.position)) : true)) { triggerEnter?.Invoke(other); } }