private void updateInteractionModeAndGazeTriggerType() { if (this.OverrideSystemSettings) { if ((this.InteractionMode_User != this.CustomInputModule) || (this.preOverrideSystemSettings != this.OverrideSystemSettings)) { if (this.InteractionMode_User != this.CustomInputModule) { this.InteractionMode_User = this.CustomInputModule; PrintDebugLog("updateInteractionModeAndGazeTriggerType() Set interaction mode " + this.InteractionMode_User + " due to CustomInputModule changed."); } if (this.preOverrideSystemSettings != this.OverrideSystemSettings) { this.preOverrideSystemSettings = this.OverrideSystemSettings; PrintDebugLog("updateInteractionModeAndGazeTriggerType() Set interaction mode " + this.InteractionMode_User + " due to OverrideSystemSettings changed."); } if (!Application.isEditor) { WVR_InteractionMode _mode = (this.InteractionMode_User == WaveVR_EInputModule.Controller) ? WVR_InteractionMode.WVR_InteractionMode_Controller : WVR_InteractionMode.WVR_InteractionMode_Gaze; Interop.WVR_SetInteractionMode(_mode); } } updateGazeTriggerType_User(); if (this.gazeTriggerType_User_pre != this.gazeTriggerType_User) { this.gazeTriggerType_User_pre = this.gazeTriggerType_User; if (!Application.isEditor) { Interop.WVR_SetGazeTriggerType(this.gazeTriggerType_User); } PrintDebugLog("updateInteractionModeAndGazeTriggerType() Gaze Trigger - User: " + this.gazeTriggerType_User_pre); } updateInputModuleByCustomSettings(); } else { if (this.preOverrideSystemSettings != this.OverrideSystemSettings) { this.preOverrideSystemSettings = this.OverrideSystemSettings; // Restore runtime mirror system setting. if (!Application.isEditor) { Interop.WVR_SetInteractionMode(WVR_InteractionMode.WVR_InteractionMode_SystemDefault); } } if (!Application.isEditor) { this.InteractionMode_System = Interop.WVR_GetInteractionMode(); this.gazeTriggerType_System = Interop.WVR_GetGazeTriggerType(); } updateInputModuleBySystemSetting(); } }
private void initInteractionModeAndGazeTriggerType() { this.preOverrideSystemSettings = this.OverrideSystemSettings; this.InteractionMode_User = this.CustomInputModule; updateGazeTriggerType_User(); // set gazeTriggerType_User if (this.OverrideSystemSettings) { if (!Application.isEditor) { // Get default system settings. this.InteractionMode_System = Interop.WVR_GetInteractionMode(); this.gazeTriggerType_System = Interop.WVR_GetGazeTriggerType(); WVR_InteractionMode _mode = (this.InteractionMode_User == WaveVR_EInputModule.Controller) ? WVR_InteractionMode.WVR_InteractionMode_Controller : WVR_InteractionMode.WVR_InteractionMode_Gaze; // Change system settings to user settings. Interop.WVR_SetInteractionMode(_mode); Interop.WVR_SetGazeTriggerType(this.gazeTriggerType_User); this.gazeTriggerType_User_pre = this.gazeTriggerType_User; } // Initialize by user settings. initializeInputModuleByCustomSettings(); } else { if (!Application.isEditor) { // Reset runtime settings to system default if no override. Interop.WVR_SetInteractionMode(WVR_InteractionMode.WVR_InteractionMode_SystemDefault); // Get default system settings. this.InteractionMode_System = Interop.WVR_GetInteractionMode(); this.gazeTriggerType_System = Interop.WVR_GetGazeTriggerType(); } // Initialize by system settings. initializeInputModuleBySystemSetting(); } this.InteractionMode_Current = GetInteractionMode(); PrintDebugLog("initInteractionModeAndGazeTriggerType() OverrideSystemSettings: " + OverrideSystemSettings); PrintDebugLog("initInteractionModeAndGazeTriggerType() Interaction Mode - System: " + this.InteractionMode_System + ", User: "******", Current: " + this.InteractionMode_Current); PrintDebugLog("initInteractionModeAndGazeTriggerType() Gaze Trigger - System: " + this.gazeTriggerType_System + ", User: " + this.gazeTriggerType_User); }
private void updateInteractionModeAndGazeTriggerType() { if (Log.gpl.Print) { DEBUG(this.OverrideSystemSettings ? "updateInteractionModeAndGazeTriggerType() OverrideSystemSettings is true." : "updateInteractionModeAndGazeTriggerType() OverrideSystemSettings is false."); DEBUG(InteractionMode_System == WVR_InteractionMode.WVR_InteractionMode_Gaze ? "updateInteractionModeAndGazeTriggerType() InteractionMode_System is gaze." : "updateInteractionModeAndGazeTriggerType() InteractionMode_System is controller."); DEBUG(InteractionMode_User == WaveVR_EInputModule.Controller ? "updateInteractionModeAndGazeTriggerType() InteractionMode_User is controller." : "updateInteractionModeAndGazeTriggerType() InteractionMode_User is gaze."); if (gazeTriggerType_System == WVR_GazeTriggerType.WVR_GazeTriggerType_Timeout) { DEBUG("updateInteractionModeAndGazeTriggerType() gazeTriggerType_System is timeout."); } if (gazeTriggerType_System == WVR_GazeTriggerType.WVR_GazeTriggerType_Button) { DEBUG("updateInteractionModeAndGazeTriggerType() gazeTriggerType_System is button."); } if (gazeTriggerType_System == WVR_GazeTriggerType.WVR_GazeTriggerType_TimeoutButton) { DEBUG("updateInteractionModeAndGazeTriggerType() gazeTriggerType_System is timeout & button."); } if (gazeTriggerType_User == WVR_GazeTriggerType.WVR_GazeTriggerType_Timeout) { DEBUG("updateInteractionModeAndGazeTriggerType() gazeTriggerType_User is timeout."); } if (gazeTriggerType_User == WVR_GazeTriggerType.WVR_GazeTriggerType_Button) { DEBUG("updateInteractionModeAndGazeTriggerType() gazeTriggerType_User is button."); } if (gazeTriggerType_User == WVR_GazeTriggerType.WVR_GazeTriggerType_TimeoutButton) { DEBUG("updateInteractionModeAndGazeTriggerType() gazeTriggerType_User is timeout & button."); } } if (this.OverrideSystemSettings) { if ((this.InteractionMode_User != this.CustomInputModule) || (this.preOverrideSystemSettings != this.OverrideSystemSettings)) { if (this.InteractionMode_User != this.CustomInputModule) { this.InteractionMode_User = this.CustomInputModule; DEBUG(this.InteractionMode_User == WaveVR_EInputModule.Controller ? "updateInteractionModeAndGazeTriggerType() InteractionMode_User is controller." : "updateInteractionModeAndGazeTriggerType() InteractionMode_User is gaze."); } if (this.preOverrideSystemSettings != this.OverrideSystemSettings) { this.preOverrideSystemSettings = this.OverrideSystemSettings; DEBUG(this.OverrideSystemSettings ? "updateInteractionModeAndGazeTriggerType() OverrideSystemSettings is true." : "updateInteractionModeAndGazeTriggerType() OverrideSystemSettings is false."); } WVR_InteractionMode _mode = (this.InteractionMode_User == WaveVR_EInputModule.Controller) ? WVR_InteractionMode.WVR_InteractionMode_Controller : WVR_InteractionMode.WVR_InteractionMode_Gaze; Interop.WVR_SetInteractionMode(_mode); } updateGazeTriggerType_User(); if (this.gazeTriggerType_User_pre != this.gazeTriggerType_User) { this.gazeTriggerType_User_pre = this.gazeTriggerType_User; Interop.WVR_SetGazeTriggerType(this.gazeTriggerType_User); if (gazeTriggerType_User == WVR_GazeTriggerType.WVR_GazeTriggerType_Timeout) { DEBUG("updateInteractionModeAndGazeTriggerType() gazeTriggerType_User is timeout."); } if (gazeTriggerType_User == WVR_GazeTriggerType.WVR_GazeTriggerType_Button) { DEBUG("updateInteractionModeAndGazeTriggerType() gazeTriggerType_User is button."); } if (gazeTriggerType_User == WVR_GazeTriggerType.WVR_GazeTriggerType_TimeoutButton) { DEBUG("updateInteractionModeAndGazeTriggerType() gazeTriggerType_User is timeout & button."); } } updateInputModuleByCustomSettings(); } else { if (this.preOverrideSystemSettings != this.OverrideSystemSettings) { this.preOverrideSystemSettings = this.OverrideSystemSettings; // Restore runtime mirror system setting. Interop.WVR_SetInteractionMode(WVR_InteractionMode.WVR_InteractionMode_SystemDefault); } this.InteractionMode_System = WaveVR.Instance.InteractionMode; this.gazeTriggerType_System = WaveVR.Instance.GazeTriggerType; updateInputModuleBySystemSetting(); } }