コード例 #1
0
        public static bool CheckForPointerTarget(Collider checkCollider, PhysicsPointer pointer)
        {
            IPointerTarget target = null;

            if (checkCollider == null)
            {
                return(false);
            }

            if (checkCollider.attachedRigidbody != null)
            {
                target = checkCollider.attachedRigidbody.GetComponent(typeof(IPointerTarget)) as IPointerTarget;
            }
            else
            {
                target = checkCollider.GetComponent(typeof(IPointerTarget)) as IPointerTarget;
            }

            if (target != null)
            {
                target.OnPointerTarget(pointer);
            }

            return(target != null);
        }
コード例 #2
0
 public ControlPointerEventController(Control control, IPointerTarget target)
     : base(target)
 {
     _control             = control;
     _control.MouseDown  += TargetMouseDown;
     _control.MouseUp    += TargetMouseUp;
     _control.MouseMove  += TargetMouseMove;
     _control.MouseLeave += TargetMouseLeave;
     _control.MouseClick += TargetMouseClick;
 }
コード例 #3
0
 public PointerEventController(IPointerTarget target)
 {
     _target = target;
 }
コード例 #4
0
 public ControlPointerEventController(Control control, IPointerTarget target)
     : base(target)
 {
     _control = control;
     _control.MouseDown += TargetMouseDown;
     _control.MouseUp += TargetMouseUp;
     _control.MouseMove += TargetMouseMove;
     _control.MouseLeave += TargetMouseLeave;
     _control.MouseClick += TargetMouseClick;
 }
コード例 #5
0
 public PointerEventController(IPointerTarget target)
 {
     _target = target;
 }