@@ -64,6 +64,8 @@ public static partial class VIUSettingsEditor
6464 public const string URL_WAVE_VR_PLUGIN = "https://developer.vive.com/resources/knowledgebase/wave-sdk/" ;
6565 public const string URL_WAVE_VR_6DOF_SUMULATOR_USAGE_PAGE = "https://github.com/ViveSoftware/ViveInputUtility-Unity/wiki/Wave-VR-6-DoF-Controller-Simulator" ;
6666 private const string WAVE_XR_PACKAGE_NAME = "com.htc.upm.wave.xrsdk" ;
67+ private const string WAVE_XR_PACKAGE_NATIVE_NAME = "com.htc.upm.wave.native" ;
68+ private const string WAVE_XR_PACKAGE_ESSENCE_NAME = "com.htc.upm.wave.essence" ;
6769
6870 public static bool canSupportWaveVR
6971 {
@@ -190,16 +192,16 @@ public override bool support
190192
191193 public override void OnPreferenceGUI ( )
192194 {
193- const string title = "WaveVR" ;
195+ const string title = "Wave XR" ;
196+ const float wvrToggleWidth = 226f ;
194197 if ( canSupport )
195198 {
196199 var wasSupported = support ;
197- support = m_foldouter . ShowFoldoutButtonOnToggleEnabled ( new GUIContent ( title , "VIVE Focus, VIVE Focus Plus " ) , wasSupported ) ;
200+ support = m_foldouter . ShowFoldoutButtonOnToggleEnabled ( new GUIContent ( title , "VIVE Focus, VIVE Flow " ) , wasSupported ) ;
198201 s_symbolChanged |= wasSupported != support ;
199202 }
200203 else
201204 {
202- const float wvrToggleWidth = 226f ;
203205 GUILayout . BeginHorizontal ( ) ;
204206 Foldouter . ShowFoldoutBlank ( ) ;
205207
@@ -256,27 +258,100 @@ public override void OnPreferenceGUI()
256258 EditorGUI . indentLevel += 2 ;
257259
258260 EditorGUILayout . BeginHorizontal ( ) ;
261+ {
262+ EditorGUIUtility . labelWidth = 230 ;
263+ var style = new GUIStyle ( GUI . skin . textField ) { alignment = TextAnchor . MiddleLeft } ;
264+ VIUSettings . waveVRAndroidManifestPath = EditorGUILayout . DelayedTextField ( new GUIContent ( "Customized AndroidManifest Path:" , "Default path: " + defaultAndroidManifestPath ) ,
265+ VIUSettings . waveVRAndroidManifestPath , style ) ;
259266
260- EditorGUIUtility . labelWidth = 230 ;
261- var style = new GUIStyle ( GUI . skin . textField ) { alignment = TextAnchor . MiddleLeft } ;
262- VIUSettings . waveVRAndroidManifestPath = EditorGUILayout . DelayedTextField ( new GUIContent ( "Customized AndroidManifest Path:" , "Default path: " + defaultAndroidManifestPath ) ,
263- VIUSettings . waveVRAndroidManifestPath , style ) ;
264- if ( GUILayout . Button ( "Open" , new GUILayoutOption [ ] { GUILayout . Width ( 44 ) , GUILayout . Height ( 18 ) } ) )
267+ s_guiChanged |= EditorGUI . EndChangeCheck ( ) ;
268+ if ( GUILayout . Button ( "Open" , new GUILayoutOption [ ] { GUILayout . Width ( 44 ) , GUILayout . Height ( 18 ) } ) )
269+ {
270+ VIUSettings . waveVRAndroidManifestPath = EditorUtility . OpenFilePanel ( "Select AndroidManifest.xml" , string . Empty , "xml" ) ;
271+ }
272+ EditorGUI . BeginChangeCheck ( ) ;
273+ }
274+ EditorGUILayout . EndHorizontal ( ) ;
275+
276+ EditorGUILayout . BeginHorizontal ( ) ;
265277 {
266- VIUSettings . waveVRAndroidManifestPath = EditorUtility . OpenFilePanel ( "Select AndroidManifest.xml" , string . Empty , "xml" ) ;
278+ if ( ! string . IsNullOrEmpty ( VIUSettings . waveVRAndroidManifestPath ) && ! File . Exists ( VIUSettings . waveVRAndroidManifestPath ) )
279+ {
280+ EditorGUILayout . HelpBox ( "File does not existed!" , MessageType . Warning ) ;
281+ }
267282 }
283+ EditorGUILayout . EndHorizontal ( ) ;
268284
285+ const string enableWaveXRRenderModelTitle = "Enable Wave XR Render Model" ;
286+ EditorGUILayout . BeginHorizontal ( ) ;
287+ #if VIU_WAVEXR_ESSENCE_CONTROLLER_MODEL || VIU_WAVEXR_ESSENCE_RENDERMODEL
288+ VIUSettings . enableWaveXRRenderModel = EditorGUILayout . ToggleLeft ( new GUIContent ( enableWaveXRRenderModelTitle , VIUSettings . ENABLE_WAVE_XR_RENDER_MODEL_TOOLTIP ) , VIUSettings . enableWaveXRRenderModel ) ;
289+ #else
290+ GUI . enabled = false ;
291+ EditorGUILayout . ToggleLeft ( new GUIContent ( enableWaveXRRenderModelTitle , VIUSettings . ENABLE_WAVE_XR_RENDER_MODEL_TOOLTIP + ". Required Wave XR Plugin Essence" ) , false , GUILayout . ExpandWidth ( true ) ) ;
292+ GUI . enabled = true ;
293+
294+ s_guiChanged |= EditorGUI . EndChangeCheck ( ) ;
295+ if ( GUILayout . Button ( new GUIContent ( "Add Wave XR Plugin Essence" , "Add " + WAVE_XR_PACKAGE_NAME + " to Package Manager" ) , GUILayout . ExpandWidth ( false ) ) )
296+ {
297+ if ( ! ManifestUtils . CheckRegistryExists ( RegistryToolSettings . Instance ( ) . Registry ) )
298+ {
299+ ManifestUtils . AddRegistry ( RegistryToolSettings . Instance ( ) . Registry ) ;
300+ }
301+
302+ if ( ! PackageManagerHelper . IsPackageInList ( WAVE_XR_PACKAGE_ESSENCE_NAME ) )
303+ {
304+ PackageManagerHelper . AddToPackageList ( WAVE_XR_PACKAGE_ESSENCE_NAME ) ;
305+ }
306+
307+ VIUProjectSettings . Instance . isInstallingWaveXRPlugin = true ;
308+ }
269309 EditorGUI . BeginChangeCheck ( ) ;
310+ #endif
270311 EditorGUILayout . EndHorizontal ( ) ;
271312
313+ const string enableWaveHandTrackingTitle = "Enable Wave Hand Tracking" ;
272314 EditorGUILayout . BeginHorizontal ( ) ;
273-
274- if ( ! string . IsNullOrEmpty ( VIUSettings . waveVRAndroidManifestPath ) && ! File . Exists ( VIUSettings . waveVRAndroidManifestPath ) )
315+ #if VIU_WAVEVR_HAND_TRACKING_CHECK
275316 {
276- EditorGUILayout . HelpBox ( "File does not existed!" , MessageType . Warning ) ;
317+ var supported = Wave . XR . BuildCheck . CheckIfHandTrackingEnabled . ValidateEnabled ( ) && VRModuleSettings . activateWaveHandTrackingSubmodule ;
318+ var shouldSupport = EditorGUILayout . ToggleLeft ( new GUIContent ( enableWaveHandTrackingTitle ) , supported ) ;
319+ if ( supported != shouldSupport )
320+ {
321+ Wave . XR . BuildCheck . CheckIfHandTrackingEnabled . PerformAction ( shouldSupport ) ;
322+ VRModuleSettings . activateWaveHandTrackingSubmodule = shouldSupport ;
323+ }
277324 }
325+ #else
326+ GUI . enabled = false ;
327+ EditorGUILayout . ToggleLeft ( new GUIContent ( enableWaveHandTrackingTitle , "Wave XR Plugin Essence required." ) , false , GUILayout . ExpandWidth ( true ) ) ;
328+ GUI . enabled = true ;
278329
330+ s_guiChanged |= EditorGUI . EndChangeCheck ( ) ;
331+ if ( GUILayout . Button ( new GUIContent ( "Update Wave XR Plugin" , "Update " + WAVE_XR_PACKAGE_NAME + " to lateast version" ) , GUILayout . ExpandWidth ( false ) ) )
332+ {
333+ if ( ! ManifestUtils . CheckRegistryExists ( RegistryToolSettings . Instance ( ) . Registry ) )
334+ {
335+ ManifestUtils . AddRegistry ( RegistryToolSettings . Instance ( ) . Registry ) ;
336+ }
337+
338+ if ( PackageManagerHelper . IsPackageInList ( WAVE_XR_PACKAGE_ESSENCE_NAME ) )
339+ {
340+ PackageManagerHelper . AddToPackageList ( WAVE_XR_PACKAGE_ESSENCE_NAME ) ;
341+ }
342+ else if ( PackageManagerHelper . IsPackageInList ( WAVE_XR_PACKAGE_NATIVE_NAME ) )
343+ {
344+ PackageManagerHelper . AddToPackageList ( WAVE_XR_PACKAGE_NATIVE_NAME ) ;
345+ }
346+ else
347+ {
348+ PackageManagerHelper . AddToPackageList ( WAVE_XR_PACKAGE_NAME ) ;
349+ }
350+
351+ VIUProjectSettings . Instance . isInstallingWaveXRPlugin = true ;
352+ }
279353 EditorGUI . BeginChangeCheck ( ) ;
354+ #endif
280355 EditorGUILayout . EndHorizontal ( ) ;
281356
282357 VIUSettings . waveVRAddVirtualArmTo3DoFController = EditorGUILayout . ToggleLeft ( new GUIContent ( "Add Virtual Arm for 3 Dof Controller" ) , VIUSettings . waveVRAddVirtualArmTo3DoFController ) ;
0 commit comments