예제 #1
0
 protected override void OnTap(PointerEventData ed)
 {
     if (_rt.IsPointInRect(ed.position, _camera))
     {
         OnEndInside?.Invoke(ed);
     }
     else
     {
         OnEndOutside?.Invoke(ed);
     }
 }
예제 #2
0
        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);
            }
        }
예제 #3
0
        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);
            }
        }