public bool GetButon(XR_Enum.FeatureUsageButton featureUsage, XR_Enum.Hand hand) { XR_Controller controller = GetHandController(hand); if (controller == null) { return(false); } switch (featureUsage) { case XR_Enum.FeatureUsageButton.PrimaryButton: return(controller.IsPrimaryPressed); case XR_Enum.FeatureUsageButton.PrimaryTouch: return(controller.IsPrimaryTouched); case XR_Enum.FeatureUsageButton.SecondaryButton: return(controller.IsSecondaryPressed); case XR_Enum.FeatureUsageButton.SecondaryTouch: return(controller.IsSecondaryTouched); case XR_Enum.FeatureUsageButton.GripButton: return(controller.IsGripPressed); case XR_Enum.FeatureUsageButton.TriggerButton: return(controller.IsTriggerPressed); case XR_Enum.FeatureUsageButton.MenuButton: return(controller.IsMenuPressed); case XR_Enum.FeatureUsageButton.Primary2DAxisClick: return(controller.IsPrimary2DAxisPressed); case XR_Enum.FeatureUsageButton.Primary2DAxisTouch: return(controller.IsPrimary2DAxisTouch); case XR_Enum.FeatureUsageButton.Thumbrest: return(controller.IsThumbrestPressed); default: return(false); } }
public static bool GetButon(XR_Enum.FeatureUsageButton featureUsage, XR_Enum.Hand hand) { switch (SDKSetup.GetSDKType) { case XR_Enum.SDKType.XR: return(SDKSetup.Instance.XRManager.InputManager.GetButon(featureUsage, hand)); //case XR_Enum.SDKType.WaveVR: default: return(false); } }
protected override void XR_InputManager_OnButtonPressed(bool action, XR_Enum.Hand hand, XR_Enum.FeatureUsageButton usageButton) { int usageButtonInt = (int)usageButton; switch (usageButtonInt) { case (int)XR_Enum.Daydream_Button.App: { } break; case (int)XR_Enum.Daydream_Button.GripPress: { } break; case (int)XR_Enum.Daydream_Button.TriggerPress: { } break; case (int)XR_Enum.Daydream_Button.TouchpadClick: { } break; case (int)XR_Enum.Daydream_Button.TouchpadTouch: { } break; } }
protected override void XR_InputManager_OnButtonPressed(bool action, XR_Enum.Hand hand, XR_Enum.FeatureUsageButton usageButton) { int usageButtonInt = (int)usageButton; switch (usageButtonInt) { case (int)XR_Enum.HTC_Vive_Button.Primary: { } break; case (int)XR_Enum.HTC_Vive_Button.GripPress: { } break; case (int)XR_Enum.HTC_Vive_Button.TriggerPress: { } break; case (int)XR_Enum.HTC_Vive_Button.StickOrPadPress: { } break; case (int)XR_Enum.HTC_Vive_Button.StickOrPadTouch: { } break; } }
protected abstract void XR_InputManager_OnButtonPressed(bool action, XR_Enum.Hand hand, XR_Enum.FeatureUsageButton usageButton);
protected override void XR_InputManager_OnButtonPressed(bool action, XR_Enum.Hand hand, XR_Enum.FeatureUsageButton usageButton) { int usageButtonInt = (int)usageButton; switch (usageButtonInt) { case (int)XR_Enum.GearVR_Button.TriggerPress: { if (action) { #if CUSTOM_LEAN_TWEEN initialPos = triggerButton.transform.localPosition; LeanTween.moveLocal(triggerButton, triggerButton.transform.localPosition - new Vector3(0, 0, 0.004f), 0.2f); #endif } else { #if CUSTOM_LEAN_TWEEN LeanTween.moveLocal(triggerButton, initialPos, 0.2f); #endif } } break; case (int)XR_Enum.GearVR_Button.TouchpadClick: { meshRenderer = touchPadButton.GetComponent <MeshRenderer>(); if (action) { meshRenderer.material.color = new Color32(0, 30, 255, 255); Debug.Log("TouchpadClick"); } else { meshRenderer.material.color = Color.white; } } break; case (int)XR_Enum.GearVR_Button.TouchpadTouch: { meshRenderer = touchPadButton.GetComponent <MeshRenderer>(); if (action) { meshRenderer.material.color = new Color32(0, 118, 255, 255); Debug.Log("TouchpadTouch"); } else { meshRenderer.material.color = Color.white; } } break; } }
public static void InvokeButtonPress(bool action, XR_Enum.Hand hand, XR_Enum.FeatureUsageButton usageButton) { //Debug.Log(hand.ToString() + " InvokeButtonPress " + action + " UsageType: " + usageButton); OnButtonPressed?.Invoke(action, hand, usageButton); }
protected override void XR_InputManager_OnButtonPressed(bool action, XR_Enum.Hand hand, XR_Enum.FeatureUsageButton usageButton) { int usageButtonInt = (int)usageButton; switch (usageButtonInt) { case (int)XR_Enum.Oculus_Button.XA_Press: { } break; case (int)XR_Enum.Oculus_Button.XA_Touch: { } break; case (int)XR_Enum.Oculus_Button.YB_Press: { } break; case (int)XR_Enum.Oculus_Button.YB_Touch: { } break; case (int)XR_Enum.Oculus_Button.GripPress: { } break; case (int)XR_Enum.Oculus_Button.IndexTouch: { } break; case (int)XR_Enum.Oculus_Button.Start: { } break; case (int)XR_Enum.Oculus_Button.ThumbRestTouch: { } break; case (int)XR_Enum.Oculus_Button.ThumbstickClick: { } break; case (int)XR_Enum.Oculus_Button.ThumbstickTouch: { } break; } }