Пример #1
0
        bool TryDoCapturingUI()
        {
            if (pCapturing == null)
            {
                return(false);
            }

            Ray eyeRay = GetWorldRayAtWorkplaneCursor();

            if (Input.GetMouseButtonUp(0))
            {
                pCapturing.EndCapture(eyeRay);
                pCapturing = null;
                return(true);
            }
            else if (Input.GetMouseButton(0))
            {
                pCapturing.UpdateCapture(eyeRay);
                return(true);
            }
            else
            {
                Debug.Log("[SceneController::TryDoCapturingUI] mouse is not pressed or up, why are we here?");
                return(false);
            }
        }
        public override Capture UpdateCapture(InputState input, CaptureData data)
        {
            SceneUIElement uiElem = data.custom_data as SceneUIElement;

            if ((data.which == CaptureSide.Left && input.bLeftTriggerReleased) ||
                (data.which == CaptureSide.Right && input.bRightTriggerReleased))
            {
                if (uiElem != null)
                {
                    uiElem.EndCapture(InputEvent.Spatial(data.which, input));
                }
                return(Capture.End);
            }
            else if ((data.which == CaptureSide.Left && input.bLeftTriggerDown) ||
                     (data.which == CaptureSide.Right && input.bRightTriggerDown))
            {
                if (uiElem != null)
                {
                    uiElem.UpdateCapture(InputEvent.Spatial(data.which, input));
                }
                return(Capture.Continue);
            }
            else
            {
                // [RMS] can end up here sometimes in Gamepad if we do camera controls
                //   while we are capturing...
                return(Capture.End);
            }
        }
Пример #3
0
 public override Capture UpdateCapture(InputState input, CaptureData data)
 {
     if (input.bTouchDown)
     {
         pCapturing.UpdateCapture(InputEvent.Touch(input));
         return(Capture.Continue);
     }
     else if (input.bTouchReleased)
     {
         pCapturing.EndCapture(InputEvent.Touch(input));
         pCapturing = null;
         return(Capture.End);
     }
     else
     {
         DebugUtil.Log(2, "TouchUIBehavior.UpdateCapture: somehow ended up bere without left mouse release!");
         if (pCapturing != null)
         {
             pCapturing.EndCapture(InputEvent.Touch(input));
             pCapturing = null;
         }
         return(Capture.End);
     }
 }
Пример #4
0
 public override Capture UpdateCapture(InputState input, CaptureData data)
 {
     if (input.bLeftMouseDown)
     {
         pCapturing.UpdateCapture(InputEvent.Mouse(input.ToOrthoLayerInput()));
         return(Capture.Continue);
     }
     else if (input.bLeftMouseReleased)
     {
         pCapturing.EndCapture(InputEvent.Mouse(input.ToOrthoLayerInput()));
         pCapturing = null;
         return(Capture.End);
     }
     else
     {
         DebugUtil.Log(2, "Mouse2DCockpitUIBehavior.UpdateCapture: somehow ended up here without left mouse release!");
         if (pCapturing != null)
         {
             pCapturing.EndCapture(InputEvent.Mouse(input.ToOrthoLayerInput()));
             pCapturing = null;
         }
         return(Capture.End);
     }
 }
Пример #5
0
 public override Capture UpdateCapture(InputState input, CaptureData data)
 {
     if ((ActiveInput == WhichInput.LeftTrigger && input.bLeftTriggerDown) ||
         (ActiveInput == WhichInput.AButton && input.bAButtonDown))
     {
         pCapturing.UpdateCapture(InputEvent.Gamepad(input));
         return(Capture.Continue);
     }
     else if ((ActiveInput == WhichInput.LeftTrigger && input.bLeftTriggerReleased) ||
              (ActiveInput == WhichInput.AButton && input.bAButtonReleased))
     {
         pCapturing.EndCapture(InputEvent.Gamepad(input));
         pCapturing  = null;
         ActiveInput = WhichInput.None;
         return(Capture.End);
     }
     else
     {
         // [RMS] can end up here sometimes in Gamepad if we do camera controls
         //   while we are capturing...
         ActiveInput = WhichInput.None;
         return(Capture.End);
     }
 }