Skip to content

Commit

Permalink
Update version code to v1.18.2
Browse files Browse the repository at this point in the history
* Bug Fixes
  - Fix Meta Pro controller input not handled when using latest Oculus plugin
  - Fix unable to enable platform support in VIU Settings when using latest Unity XR Plugin Management
  • Loading branch information
lawwong committed Aug 18, 2023
2 parents f266c2b + 1bcc4c8 commit d378bdc
Show file tree
Hide file tree
Showing 16 changed files with 40 additions and 29 deletions.
2 changes: 2 additions & 0 deletions Assets/HTC.UnityPlugin/VRModule/Modules/OculusVRModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,7 @@ public override void BeforeRenderUpdate()
case VRModuleDeviceModel.OculusTouchLeft:
case VRModuleDeviceModel.OculusQuestControllerLeft:
case VRModuleDeviceModel.OculusQuest2ControllerLeft:
case VRModuleDeviceModel.OculusTouchProLeft:
{
var ctrlState = OVRPlugin.GetControllerState((uint)OVRPlugin.Controller.LTouch);

Expand Down Expand Up @@ -842,6 +843,7 @@ public override void BeforeRenderUpdate()
case VRModuleDeviceModel.OculusTouchRight:
case VRModuleDeviceModel.OculusQuestControllerRight:
case VRModuleDeviceModel.OculusQuest2ControllerRight:
case VRModuleDeviceModel.OculusTouchProRight:
{
var ctrlState = OVRPlugin.GetControllerState((uint)OVRPlugin.Controller.RTouch);

Expand Down
4 changes: 2 additions & 2 deletions Assets/HTC.UnityPlugin/VRModule/Modules/SimulatorModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ public override void OnDeactivated()
}
}

public override uint GetRightControllerDeviceIndex() { return RIGHT_INDEX; }
public override uint GetRightControllerDeviceIndex() { return m_currStates != null && m_currStates[RIGHT_INDEX].isConnected ? RIGHT_INDEX : VRModule.INVALID_DEVICE_INDEX; }

public override uint GetLeftControllerDeviceIndex() { return LEFT_INDEX; }
public override uint GetLeftControllerDeviceIndex() { return m_currStates != null && m_currStates[LEFT_INDEX].isConnected ? LEFT_INDEX : VRModule.INVALID_DEVICE_INDEX; }

public override void Update()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ public override bool support
if (editorGraphicsJobs) { return false; }
#if UNITY_2019_3_OR_NEWER
if (!VIUSettings.activateOculusVRModule && !VIUSettings.activateUnityXRModule) { return false; }
if (!XRPluginManagementUtils.IsXRLoaderEnabled(OculusVRModule.OCULUS_XR_LOADER_NAME, requirdPlatform)) { return false; }
if (!XRPluginManagementUtils.IsXRLoaderEnabled(OculusVRModule.OCULUS_XR_LOADER_NAME, OculusVRModule.OCULUS_XR_LOADER_CLASS_NAME, requirdPlatform)) { return false; }
#else
if (!VIUSettings.activateOculusVRModule && !VIUSettings.activateUnityNativeVRModule) { return false; }
if (!OculusSDK.enabled) { return false; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public override bool support
if (!canSupport) { return false; }
#if UNITY_2019_3_OR_NEWER
if (!VIUSettings.activateOculusVRModule && !VIUSettings.activateUnityXRModule) { return false; }
if (!XRPluginManagementUtils.IsXRLoaderEnabled(OculusVRModule.OCULUS_XR_LOADER_NAME, requirdPlatform)) { return false; }
if (!XRPluginManagementUtils.IsXRLoaderEnabled(OculusVRModule.OCULUS_XR_LOADER_NAME, OculusVRModule.OCULUS_XR_LOADER_CLASS_NAME, requirdPlatform)) { return false; }
#elif UNITY_5_5_OR_NEWER
if (!VIUSettings.activateOculusVRModule && !VIUSettings.activateUnityNativeVRModule) { return false; }
if (!OculusSDK.enabled) { return false; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ public override bool support
{
if (!canSupport) { return false; }
#if UNITY_2019_3_OR_NEWER
return (VIUSettings.activateSteamVRModule || VIUSettings.activateUnityXRModule) && XRPluginManagementUtils.IsXRLoaderEnabled(SteamVRModule.OPENVR_XR_LOADER_NAME, requirdPlatform);
return (VIUSettings.activateSteamVRModule || VIUSettings.activateUnityXRModule) && XRPluginManagementUtils.IsXRLoaderEnabled(SteamVRModule.OPENVR_XR_LOADER_NAME, SteamVRModule.OPENVR_XR_LOADER_CLASS_NAME, requirdPlatform);
#elif UNITY_5_5_OR_NEWER
return (VIUSettings.activateSteamVRModule || VIUSettings.activateUnityNativeVRModule) && OpenVRSDK.enabled;
#elif UNITY_5_4_OR_NEWER
Expand Down Expand Up @@ -629,7 +629,7 @@ public override void OnPreferenceGUI()
{
bool isPackageInstalled = PackageManagerHelper.IsPackageInList(OPENVR_XR_PACKAGE_NAME) ||
PackageManagerHelper.IsPackageInList(OPENVR_XR_PACKAGE_NAME_OLD);
bool isLoaderEnabled = XRPluginManagementUtils.IsXRLoaderEnabled(SteamVRModule.OPENVR_XR_LOADER_NAME, BuildTargetGroup.Standalone);
bool isLoaderEnabled = XRPluginManagementUtils.IsXRLoaderEnabled(SteamVRModule.OPENVR_XR_LOADER_NAME, SteamVRModule.OPENVR_XR_LOADER_CLASS_NAME, BuildTargetGroup.Standalone);
if (isPackageInstalled && !isLoaderEnabled)
{
XRPluginManagementUtils.SetXRLoaderEnabled(SteamVRModule.OPENVR_XR_LOADER_CLASS_NAME, BuildTargetGroup.Standalone, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public override bool canSupport
if (PackageManagerHelper.IsPackageInList(WAVE_XR_OPENXR_PACKAGE)) { return false; }
if (PackageManagerHelper.IsPackageInList(OCULUS_XR_PACKAGE_NAME)) { return false; }
if (!PackageManagerHelper.IsPackageInList(OPENXR_PLUGIN_PACKAGE_NAME)) { return false; }
if (!XRPluginManagementUtils.IsXRLoaderEnabled(OPENXR_PLUGIN_LOADER_NAME, requirdPlatform)) { return false; }
if (!XRPluginManagementUtils.IsXRLoaderEnabled(OPENXR_PLUGIN_LOADER_NAME, OPENXR_PLUGIN_LOADER_TYPE, requirdPlatform)) { return false; }
return true;
}
}
Expand All @@ -90,7 +90,7 @@ public override bool support
{
if (!canSupport) { return false; }
if (!VIUSettings.activateUnityXRModule) { return false; }
if (!XRPluginManagementUtils.IsXRLoaderEnabled(OPENXR_PLUGIN_LOADER_NAME, requirdPlatform)) { return false; }
if (!XRPluginManagementUtils.IsXRLoaderEnabled(OPENXR_PLUGIN_LOADER_NAME, OPENXR_PLUGIN_LOADER_TYPE, requirdPlatform)) { return false; }
if (IsOpenXRFeatureGroupEnabled(requirdPlatform, WAVE_XR_OPENXR_FEATURE_ID)) { return false; }
if (!IsOpenXRFeatureGroupEnabled(requirdPlatform, OCULUS_QUEST_OPENXR_FEATURE_ID)) { return false; }
return true;
Expand Down Expand Up @@ -204,7 +204,7 @@ public override void OnPreferenceGUI()
PackageManagerHelper.AddToPackageList(OPENXR_PLUGIN_PACKAGE_NAME);
}
}
else if (!XRPluginManagementUtils.IsXRLoaderEnabled(OPENXR_PLUGIN_LOADER_NAME, requirdPlatform))
else if (!XRPluginManagementUtils.IsXRLoaderEnabled(OPENXR_PLUGIN_LOADER_NAME, OPENXR_PLUGIN_LOADER_TYPE, requirdPlatform))
{
GUI.enabled = false;
ShowToggle(new GUIContent(s_title), false, GUILayout.Width(toggleWidth));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public override bool canSupport
if (PackageManagerHelper.IsPackageInList(OCULUS_XR_PACKAGE_NAME)) { return false; }
if (PackageManagerHelper.IsPackageInList(WAVE_XR_PACKAGE_NAME)) { return false; }
if (!PackageManagerHelper.IsPackageInList(WAVE_XR_OPENXR_PACKAGE)) { return false; }
if (!XRPluginManagementUtils.IsXRLoaderEnabled(OPENXR_PLUGIN_LOADER_NAME, requirdPlatform)) { return false; }
if (!XRPluginManagementUtils.IsXRLoaderEnabled(OPENXR_PLUGIN_LOADER_NAME, OPENXR_PLUGIN_LOADER_TYPE, requirdPlatform)) { return false; }
return true;
}
}
Expand All @@ -96,7 +96,7 @@ public override bool support
{
if (!canSupport) { return false; }
if (!VIUSettings.activateUnityXRModule) { return false; }
if (!XRPluginManagementUtils.IsXRLoaderEnabled(OPENXR_PLUGIN_LOADER_NAME, requirdPlatform)) { return false; }
if (!XRPluginManagementUtils.IsXRLoaderEnabled(OPENXR_PLUGIN_LOADER_NAME, OPENXR_PLUGIN_LOADER_TYPE, requirdPlatform)) { return false; }
if (IsOpenXRFeatureGroupEnabled(requirdPlatform, OCULUS_QUEST_OPENXR_FEATURE_ID)) { return false; }
if (!IsOpenXRFeatureGroupEnabled(requirdPlatform, WAVE_XR_OPENXR_FEATURE_ID)) { return false; }
return true;
Expand Down Expand Up @@ -204,7 +204,7 @@ public override void OnPreferenceGUI()
PackageManagerHelper.AddToPackageList(WAVE_XR_OPENXR_PACKAGE);
}
}
else if (!XRPluginManagementUtils.IsXRLoaderEnabled(OPENXR_PLUGIN_LOADER_NAME, requirdPlatform))
else if (!XRPluginManagementUtils.IsXRLoaderEnabled(OPENXR_PLUGIN_LOADER_NAME, OPENXR_PLUGIN_LOADER_TYPE, requirdPlatform))
{
GUI.enabled = false;
ShowToggle(new GUIContent(s_title), false, GUILayout.Width(toggleWidth));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public override bool support
{
if (!canSupport) { return false; }
if (!VIUSettings.activateUnityXRModule) { return false; }
if (!XRPluginManagementUtils.IsXRLoaderEnabled(OPENXR_PLUGIN_LOADER_NAME, requirdPlatform)) { return false; }
if (!XRPluginManagementUtils.IsXRLoaderEnabled(OPENXR_PLUGIN_LOADER_NAME, OPENXR_PLUGIN_LOADER_TYPE, requirdPlatform)) { return false; }
return true;
}
set
Expand Down Expand Up @@ -84,7 +84,7 @@ public override void OnPreferenceGUI()
PackageManagerHelper.AddToPackageList(OPENXR_PLUGIN_PACKAGE_NAME);
}
}
else if (!XRPluginManagementUtils.IsXRLoaderEnabled(OPENXR_PLUGIN_LOADER_NAME, requirdPlatform))
else if (!XRPluginManagementUtils.IsXRLoaderEnabled(OPENXR_PLUGIN_LOADER_NAME, OPENXR_PLUGIN_LOADER_TYPE, requirdPlatform))
{
GUI.enabled = false;
ShowToggle(s_title, false, GUILayout.Width(toggleWidth));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public UnityXRRecommendedSettings()
Add(new VIUVersionCheck.RecommendedSetting<int>
{
settingTitle = "Review OpenXR Project Validation Issues",
skipCheckFunc = () => !VIUSettingsEditor.PackageManagerHelper.IsPackageInList(VIUSettingsEditor.OPENXR_PLUGIN_PACKAGE_NAME) || !XRPluginManagementUtils.IsXRLoaderEnabled(UnityXRModule.OPENXR_LOADER_NAME, VIUSettingsEditor.activeBuildTargetGroup),
skipCheckFunc = () => !VIUSettingsEditor.PackageManagerHelper.IsPackageInList(VIUSettingsEditor.OPENXR_PLUGIN_PACKAGE_NAME) || !XRPluginManagementUtils.IsXRLoaderEnabled(UnityXRModule.OPENXR_LOADER_NAME, UnityXRModule.OPENXR_LOADER_CLASS_NAME, VIUSettingsEditor.activeBuildTargetGroup),
currentValueFunc = () => {
OpenXRProjectValidation.GetCurrentValidationIssues(s_tempOpenXRValidationIssues, VIUSettingsEditor.activeBuildTargetGroup);
return s_tempOpenXRValidationIssues.Count;
Expand Down Expand Up @@ -60,7 +60,7 @@ public UnityXRRecommendedSettings()
Add(new VIUVersionCheck.RecommendedSetting<bool>
{
settingTitle = "Enable All Feature Sets",
skipCheckFunc = () => !VIUSettingsEditor.PackageManagerHelper.IsPackageInList(VIUSettingsEditor.OPENXR_PLUGIN_PACKAGE_NAME) || !XRPluginManagementUtils.IsXRLoaderEnabled(UnityXRModule.OPENXR_LOADER_NAME, VIUSettingsEditor.activeBuildTargetGroup),
skipCheckFunc = () => !VIUSettingsEditor.PackageManagerHelper.IsPackageInList(VIUSettingsEditor.OPENXR_PLUGIN_PACKAGE_NAME) || !XRPluginManagementUtils.IsXRLoaderEnabled(UnityXRModule.OPENXR_LOADER_NAME, UnityXRModule.OPENXR_LOADER_CLASS_NAME, VIUSettingsEditor.activeBuildTargetGroup),
currentValueFunc = () =>
{
return OpenXRSettings.ActiveBuildTargetInstance.GetFeatures<OpenXRInteractionFeature>().All(feature => feature.enabled);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public override bool support
if (!VIUSettings.activateWaveVRModule) { return false; }

#if VIU_XR_GENERAL_SETTINGS
if (!(MockHMDSDK.enabled || XRPluginManagementUtils.IsXRLoaderEnabled(UnityXRModule.WAVE_XR_LOADER_NAME, requirdPlatform)))
if (!(MockHMDSDK.enabled || XRPluginManagementUtils.IsXRLoaderEnabled(UnityXRModule.WAVE_XR_LOADER_NAME, UnityXRModule.WAVE_XR_LOADER_CLASS_NAME, requirdPlatform)))
{
return false;
}
Expand Down Expand Up @@ -453,7 +453,7 @@ public override void OnPreferenceGUI()
if (VIUProjectSettings.Instance.isInstallingWaveXRPlugin)
{
bool isPackageInstalled = PackageManagerHelper.IsPackageInList(WAVE_XR_PACKAGE_NAME);
bool isLoaderEnabled = XRPluginManagementUtils.IsXRLoaderEnabled(UnityXRModule.WAVE_XR_LOADER_NAME, BuildTargetGroup.Android);
bool isLoaderEnabled = XRPluginManagementUtils.IsXRLoaderEnabled(UnityXRModule.WAVE_XR_LOADER_NAME, UnityXRModule.WAVE_XR_LOADER_CLASS_NAME, BuildTargetGroup.Android);
if (isPackageInstalled && !isLoaderEnabled)
{
XRPluginManagementUtils.SetXRLoaderEnabled(UnityXRModule.WAVE_XR_LOADER_CLASS_NAME, BuildTargetGroup.Android, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public override bool support
get
{
#if UNITY_2019_3_OR_NEWER
return canSupport && VIUSettings.activateUnityXRModule && XRPluginManagementUtils.IsXRLoaderEnabled(WINDOWSMR_XR_LOADER_NAME, requirdPlatform);
return canSupport && VIUSettings.activateUnityXRModule && XRPluginManagementUtils.IsXRLoaderEnabled(WINDOWSMR_XR_LOADER_NAME, WINDOWSMR_XR_LOADER_CLASS_NAME, requirdPlatform);
#elif UNITY_2018_2_OR_NEWER
return canSupport && VIUSettings.activateUnityNativeVRModule && WindowsMRSDK.enabled;
#else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace HTC.UnityPlugin.Vive
{
public static class XRPluginManagementUtils
{
public static bool IsXRLoaderEnabled(string loaderName, BuildTargetGroup buildTargetGroup)
public static bool IsXRLoaderEnabled(string loaderName, string loaderClassName, BuildTargetGroup buildTargetGroup)
{
#if VIU_XR_GENERAL_SETTINGS
XRGeneralSettings xrSettings = XRGeneralSettingsPerBuildTarget.XRGeneralSettingsForBuildTarget(buildTargetGroup);
Expand All @@ -35,7 +35,7 @@ public static bool IsXRLoaderEnabled(string loaderName, BuildTargetGroup buildTa

foreach (XRLoader loader in xrSettings.AssignedSettings.loaders)
{
if (loader.name == loaderName)
if (loader.name == loaderName || loader.name == loaderClassName)
{
return true;
}
Expand All @@ -44,7 +44,7 @@ public static bool IsXRLoaderEnabled(string loaderName, BuildTargetGroup buildTa
return false;
}

public static bool OnlyOneXRLoaderEnabled(string loaderName, BuildTargetGroup buildTargetGroup)
public static bool OnlyOneXRLoaderEnabled(string loaderName, string loaderClassName, BuildTargetGroup buildTargetGroup)
{
#if VIU_XR_GENERAL_SETTINGS
XRGeneralSettings xrSettings = XRGeneralSettingsPerBuildTarget.XRGeneralSettingsForBuildTarget(buildTargetGroup);
Expand All @@ -59,7 +59,7 @@ public static bool OnlyOneXRLoaderEnabled(string loaderName, BuildTargetGroup bu
}

var loaders = xrSettings.AssignedSettings.loaders;
return loaders.Count == 1 && loaders[0].name == loaderName;
return loaders.Count == 1 && (loaders[0].name == loaderName || loaders[0].name == loaderClassName);
#else
return false;
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ namespace HTC.UnityPlugin.Vive
{
public static class VIUVersion
{
public static readonly Version current = new Version("1.18.1.0");
public static readonly Version current = new Version("1.18.2.0");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ private void MappingLeftRightHands()
else
{
rightIndex = VRModule.GetRightControllerDeviceIndex();
if (rightIndex >= deviceCount || RoleMap.IsDeviceConnectedAndBound(rightIndex))
var rightIndexState = VRModule.GetCurrentDeviceState(rightIndex);
if (!rightIndexState.isConnected || RoleMap.IsDeviceBound(rightIndexState.serialNumber))
{
rightIndex = VRModule.INVALID_DEVICE_INDEX;
}
Expand All @@ -159,7 +160,8 @@ private void MappingLeftRightHands()
else
{
leftIndex = VRModule.GetLeftControllerDeviceIndex();
if (leftIndex >= deviceCount || RoleMap.IsDeviceConnectedAndBound(leftIndex))
var leftIndexState = VRModule.GetCurrentDeviceState(leftIndex);
if (!leftIndexState.isConnected || RoleMap.IsDeviceBound(leftIndexState.serialNumber))
{
leftIndex = VRModule.INVALID_DEVICE_INDEX;
}
Expand All @@ -172,7 +174,7 @@ private void MappingLeftRightHands()
{
if (i == rightIndex || i == leftIndex) { continue; }
var state = VRModule.GetCurrentDeviceState(i);
if (state.deviceClass != VRModuleDeviceClass.Controller) { continue; }
if (!state.isConnected || state.deviceClass != VRModuleDeviceClass.Controller) { continue; }
if (RoleMap.IsDeviceBound(state.serialNumber)) { continue; }
m_sortedDeviceList.Add(i);
}
Expand Down
2 changes: 1 addition & 1 deletion Assets/HTC.UnityPlugin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.htc.upm.vive-input-utility",
"version": "1.18.1",
"version": "1.18.2",
"displayName": "VIVE Input Utility",
"description": "The VIVE Input Utility (VIU) is a toolkit for developing VR experiences in Unity, especially with the VIVE/VIVE Pro but also targeting many platforms from a common code base including Oculus Rift, Rift S Go, Quest, Google Daydream, VIVE Wave SDK (e.g. VIVE Focus standalone) and additional VR platforms as supported by Unity such as Microsoft's 'Mixed Reality' VR headsets and more.\n\nCompatible with SteamVR 2.4.0+ and Oculus Integration 16.0+.\n\nView license:\nhttps://github.com/ViveSoftware/ViveInputUtility-Unity/blob/develop/LICENSE.md",
"keywords": [
Expand Down
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
# Vive Input Utility for Unity - v1.18.1
# Vive Input Utility for Unity - v1.18.2
Copyright (c) 2016-2023, HTC Corporation. All rights reserved.


## Changes for v1.18.2:

* Bug Fixes
- Fix Meta Pro controller input not handled when using latest Oculus plugin
- Fix unable to enable platform support in VIU Settings when using latest Unity XR Plugin Management


## Changes for v1.18.1:

* Changes
Expand Down

0 comments on commit d378bdc

Please sign in to comment.