Skip to content

Commit 32c8499

Browse files
author
lawwong
committed
Avoid "Recursive UpdateModel call" warnings
1 parent a8c1f87 commit 32c8499

2 files changed

Lines changed: 16 additions & 16 deletions

File tree

Assets/HTC.UnityPlugin/VRModule/Modules/OculusVRModule.cs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -824,20 +824,20 @@ public override void BeforeRenderUpdate()
824824
break;
825825
}
826826

827-
if (!prevState.isPoseValid)
828-
{
829-
if (currState.isPoseValid)
830-
{
831-
Debug.Log("[VIU][OculusVRModule] " + currState.deviceModel + " pose valid.");
832-
}
833-
}
834-
else
835-
{
836-
if (!currState.isPoseValid)
837-
{
838-
Debug.Log("[VIU][OculusVRModule] " + prevState.deviceModel + " pose invalid.");
839-
}
840-
}
827+
//if (!prevState.isPoseValid)
828+
//{
829+
// if (currState.isPoseValid)
830+
// {
831+
// Debug.Log("[VIU][OculusVRModule] " + currState.deviceModel + " pose valid.");
832+
// }
833+
//}
834+
//else
835+
//{
836+
// if (!currState.isPoseValid)
837+
// {
838+
// Debug.Log("[VIU][OculusVRModule] " + prevState.deviceModel + " pose invalid.");
839+
// }
840+
//}
841841
}
842842

843843
ProcessConnectedDeviceChanged();

Assets/HTC.UnityPlugin/ViveInputUtility/Scripts/Misc/RenderModelHook.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,12 +364,12 @@ private void Awake()
364364

365365
protected virtual void OnEnable()
366366
{
367+
UpdateModel();
368+
367369
VRModule.onActiveModuleChanged += OnActiveModuleChanged;
368370
VRModule.onControllerRoleChanged += UpdateModel;
369371
m_viveRole.onDeviceIndexChanged += OnDeviceIndexChanged;
370372
m_viveRole.onRoleChanged += UpdateModel;
371-
372-
UpdateModel();
373373
}
374374

375375
protected virtual void OnDisable()

0 commit comments

Comments
 (0)