Skip to content

Commit 8e7dded

Browse files
author
lawwong
committed
Fix Oculus Android options & hint when feature not supported
1 parent f5e9fe3 commit 8e7dded

1 file changed

Lines changed: 25 additions & 6 deletions

File tree

Assets/HTC.UnityPlugin/ViveInputUtility/Scripts/Editor/VRPlatformSettings/OculusGoSettings.cs

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -707,19 +707,24 @@ public override void OnPreferenceGUI()
707707
}
708708
#else
709709
{
710-
EditorGUILayout.BeginHorizontal();
711-
712710
var wasGUIEnabled = GUI.enabled;
713711
GUI.enabled = false;
714-
EditorGUILayout.ToggleLeft(new GUIContent(enableHandTrackingTitle, "Hand tracking not supported. Please install latest Oculus Integration."), false);
715-
GUI.enabled = wasGUIEnabled;
716712

713+
EditorGUILayout.BeginHorizontal();
714+
EditorGUILayout.ToggleLeft(new GUIContent(enableHandTrackingTitle, "Hand tracking not supported. Please import latest Oculus Integration."), false, GUILayout.Width(280f));
717715
GUILayout.FlexibleSpace();
718-
ShowUrlLinkButton(URL_OCULUS_VR_PLUGIN, "Get Oculus Integration");
719-
716+
GUI.enabled = true;
717+
ShowUrlLinkButton(URL_OCULUS_VR_PLUGIN, "Update Oculus Integration");
720718
EditorGUILayout.EndHorizontal();
719+
720+
GUI.enabled = false;
721+
EditorGUILayout.ToggleLeft(new GUIContent(enableHandRenderModelTitle, VIUSettings.ENABLE_OCULUS_SDK_HAND_RENDER_MODEL_TOOLTIP), false);
722+
723+
GUI.enabled = wasGUIEnabled;
721724
}
722725
#endif
726+
727+
#pragma warning disable 0162
723728
// Controller Render Model
724729
const string enableControllerRenderModelTitle = "Enable Oculus Controller Render Model";
725730
const string enableControllerRenderModelSkeletonTitle = "Enable Hand Attached to Oculus Controller Render Model";
@@ -741,8 +746,22 @@ public override void OnPreferenceGUI()
741746
}
742747
else
743748
{
749+
var wasGUIEnabled = GUI.enabled;
750+
GUI.enabled = false;
744751

752+
EditorGUILayout.BeginHorizontal();
753+
EditorGUILayout.ToggleLeft(new GUIContent(enableControllerRenderModelTitle, "OvrAvatar not found. Please import latest Oculus Integration."), false, GUILayout.Width(280f));
754+
GUILayout.FlexibleSpace();
755+
GUI.enabled = true;
756+
ShowUrlLinkButton(URL_OCULUS_VR_PLUGIN, "Update Oculus Integration");
757+
EditorGUILayout.EndHorizontal();
758+
759+
GUI.enabled = false;
760+
EditorGUILayout.ToggleLeft(new GUIContent(enableControllerRenderModelSkeletonTitle, VIUSettings.ENABLE_OCULUS_SDK_CONTROLLER_RENDER_MODEL_SKELETON_TOOLTIP), false);
761+
762+
GUI.enabled = wasGUIEnabled;
745763
}
764+
#pragma warning restore 0162
746765

747766
// Custom Android manifest
748767
EditorGUILayout.BeginHorizontal();

0 commit comments

Comments
 (0)