Skip to content

Commit

Permalink
Merge fix for OculusVRModule
Browse files Browse the repository at this point in the history
  • Loading branch information
lawwong committed Jan 16, 2019
2 parents 37d48f7 + b8e1616 commit 8e1f883
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
24 changes: 17 additions & 7 deletions Assets/HTC.UnityPlugin/VRModule/Modules/OculusVRModule.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//========= Copyright 2016-2018, HTC Corporation. All rights reserved. ===========
//========= Copyright 2016-2018, HTC Corporation. All rights reserved. ===========

#if VIU_OCULUSVR
using UnityEngine;
Expand Down Expand Up @@ -141,7 +141,8 @@ public override void BeforeRenderUpdate()
// update device connected state
if (!prevState.isConnected)
{
var ovrProductName = OVRPlugin.productName;
var platform = OVRPlugin.GetSystemHeadsetType();
var ovrProductName = platform.ToString();
var deviceClass = s_node2class[(int)node];

currState.isConnected = true;
Expand All @@ -160,15 +161,24 @@ public override void BeforeRenderUpdate()
currState.deviceModel = VRModuleDeviceModel.OculusSensor;
break;
case VRModuleDeviceClass.Controller:
switch (ovrProductName)
switch (platform)
{
case "Oculus Go":
case OVRPlugin.SystemHeadset.Oculus_Go:
currState.deviceModel = VRModuleDeviceModel.OculusGoController;
break;
case "Gear VR":

case OVRPlugin.SystemHeadset.GearVR_R320:
case OVRPlugin.SystemHeadset.GearVR_R321:
case OVRPlugin.SystemHeadset.GearVR_R322:
case OVRPlugin.SystemHeadset.GearVR_R323:
case OVRPlugin.SystemHeadset.GearVR_R324:
case OVRPlugin.SystemHeadset.GearVR_R325:
currState.deviceModel = VRModuleDeviceModel.OculusGearVrController;
break;
case "Oculus Rift":

case OVRPlugin.SystemHeadset.Rift_DK1:
case OVRPlugin.SystemHeadset.Rift_DK2:
case OVRPlugin.SystemHeadset.Rift_CV1:
default:
switch (node)
{
Expand Down Expand Up @@ -288,4 +298,4 @@ public override void BeforeRenderUpdate()
}
#endif
}
}
}
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.10.1.3");
public static readonly Version current = new Version("1.10.1.4");
}
}

0 comments on commit 8e1f883

Please sign in to comment.