Exemplo n.º 1
0
        void LateUpdate()
        {
            if (Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift))
            {
                UpdateControllerRotateByInput();
            }

            if (NRInput.EmulateVirtualDisplayInEditor)
            {
                DefaultControllerPanel.SetActive(false);
                UpdateVirtualControllerButtons();
            }
            else
            {
                DefaultControllerPanel.SetActive(true);
                UpdateDefaultControllerButtons();
            }

            NREmulatorManager.Instance.NativeEmulatorApi.SetControllerSubmit();

            if (NRInput.GetButtonDown(ControllerButton.TRIGGER))
            {
                NRDebugger.Log("Click down Trigger button !!!");
            }
            else if (NRInput.GetButtonDown(ControllerButton.APP))
            {
                NRDebugger.Log("Click down App button !!!");
            }
            else if (NRInput.GetButtonDown(ControllerButton.HOME))
            {
                NRDebugger.Log("Click down Home button !!!");
            }
        }
 public virtual bool GetPressDown()
 {
     if (raycaster is NRMultScrPointerRaycaster)
     {
         return(MultiScreenController.SystemButtonState.pressDown);
     }
     else
     {
         return(NRInput.GetButtonDown(raycaster.RelatedHand, ControllerButton.TRIGGER));
     }
 }
Exemplo n.º 3
0
        void LateUpdate()
        {
            if (Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift))
            {
                UpdateControllerRotateByInput();
            }

            if (Input.GetMouseButtonDown(0))
            {
                SetConfirmButton(true);
                ImageConfirm.SetActive(true);
            }
            if (Input.GetMouseButtonUp(0))
            {
                SetConfirmButton(false);
                ImageConfirm.SetActive(false);
            }
            if (Input.GetMouseButtonDown(2))
            {
                SetAppButton(true);
                ImageApp.SetActive(true);
            }
            if (Input.GetMouseButtonUp(2))
            {
                SetAppButton(false);
                ImageApp.SetActive(false);
            }
            if (Input.GetMouseButtonDown(1))
            {
                SetHomeButton(true);
                ImageHome.SetActive(true);
            }
            if (Input.GetMouseButtonUp(1))
            {
                SetHomeButton(false);
                ImageHome.SetActive(false);
            }
            if (m_TouchAction != TouchActionState.Idle)
            {
                UpdateTouchAction();
            }
            else
            {
                if (Input.GetKeyDown(KeyCode.LeftArrow))
                {
                    ImageLeft.SetActive(true);
                    m_TouchAction = TouchActionState.Left;
                }
                else if (Input.GetKeyDown(KeyCode.RightArrow))
                {
                    ImageRight.SetActive(true);
                    m_TouchAction = TouchActionState.Right;
                }
                else if (Input.GetKeyDown(KeyCode.UpArrow))
                {
                    ImageUp.SetActive(true);
                    m_TouchAction = TouchActionState.Up;
                }
                else if (Input.GetKeyDown(KeyCode.DownArrow))
                {
                    ImageDown.SetActive(true);
                    m_TouchAction = TouchActionState.Down;
                }
                else if (Input.GetKeyUp(KeyCode.DownArrow)
                         | Input.GetKeyUp(KeyCode.UpArrow)
                         | Input.GetKeyUp(KeyCode.RightArrow)
                         | Input.GetKeyUp(KeyCode.LeftArrow))
                {
                    NREmulatorManager.Instance.NativeEmulatorApi.SetControllerIsTouching(false);
                }
            }

            NREmulatorManager.Instance.NativeEmulatorApi.SetControllerSubmit();


            if (NRInput.GetButtonDown(ControllerButton.TRIGGER))
            {
                NRDebugger.Log("Click down Trigger button !!!");
            }
            else if (NRInput.GetButtonDown(ControllerButton.APP))
            {
                NRDebugger.Log("Click down App button !!!");
            }
            else if (NRInput.GetButtonDown(ControllerButton.HOME))
            {
                NRDebugger.Log("Click down Home button !!!");
            }
        }
Exemplo n.º 4
0
 public virtual bool GetPressDown()
 {
     return(NRInput.GetButtonDown(ControllerButton.TRIGGER));
 }