protected override void OnTap(PointerEventData ed) { if (_rt.IsPointInRect(ed.position, _camera)) { OnEndInside?.Invoke(ed); } else { OnEndOutside?.Invoke(ed); } }
protected override void OnTap(PointerEventData ed) { Vector2 worldPos = _camera.ScreenToWorldPoint(ed.position); bool isInRect = _renderer.Contains(worldPos); if (isInRect) { OnEndInside?.Invoke(ed); } else { OnEndOutside?.Invoke(ed); } }
protected override void OnTap(PointerEventData ed) { Vector3 worldPos = _camera.ScreenToWorldPoint(ed.position); bool isInside = _collider.bounds.Contains(worldPos.SetZ(_collider.WorldPos().z)); if (isInside) { OnEndInside?.Invoke(ed); } else { OnEndOutside?.Invoke(ed); } }