private static string GetMappingPrefixVR(Controller controllerSource) { VRControllerDisplayManager.VRControllerType activeControllerType = VRControllerDisplayManager.GetActiveControllerType(); if (activeControllerType == VRControllerDisplayManager.VRControllerType.Vive) { return("VIVE_"); } if (activeControllerType == VRControllerDisplayManager.VRControllerType.OculusTouch) { return("OCTOUCH_"); } string[] matchStrings = new string[] { "Oculus Touch.*", "Oculus Controller" }; string[] matchStrings2 = new string[] { "Open VR Controller.*" }; string name = controllerSource.name; if (InputMappingIcons.GetMappingPrefix(name, matchStrings)) { return("OCTOUCH_"); } if (InputMappingIcons.GetMappingPrefix(name, matchStrings2)) { return("VIVE_"); } return(null); }
private void ProcessVRInputMappings(Player player) { VRControllerDisplayManager.VRControllerType activeControllerType = VRControllerDisplayManager.GetActiveControllerType(); if (activeControllerType != VRControllerDisplayManager.VRControllerType.Vive) { if (activeControllerType == VRControllerDisplayManager.VRControllerType.OculusTouch) { this.ProcessVROculusInputMappings(player); } } else { this.ProcessVRViveInputMappings(player); } }
private void Update() { VRControllerDisplayManager.VRControllerType vrcontrollerType = (!this.SimulateOculus) ? ((!this.SimulateVive) ? VRControllerDisplayManager.GetActiveControllerType() : VRControllerDisplayManager.VRControllerType.Vive) : VRControllerDisplayManager.VRControllerType.OculusTouch; if (this.ActiveControllerType == vrcontrollerType) { return; } this.ActiveControllerType = vrcontrollerType; if (this.ActiveControllerType == VRControllerDisplayManager.VRControllerType.Vive) { this.ShowSource(this.ViveSource, this.VivePositionOffset, this.ViveRotationOffset); } else if (this.ActiveControllerType == VRControllerDisplayManager.VRControllerType.OculusTouch) { this.ShowSource(this.OculusSource, this.OculusPositionOffset, this.OculusRotationOffset); } }