private void ActivateModule(VRModuleActiveEnum module) { if (m_activatedModule != VRModuleActiveEnum.Uninitialized) { Debug.LogError("Must deactivate before activate module! Current activatedModule:" + m_activatedModule); return; } if (module == VRModuleActiveEnum.Uninitialized) { Debug.LogError("Activate module cannot be Uninitialized! Use DeactivateModule instead"); return; } m_activatedModule = module; m_activatedModuleBase = m_modules[(int)module]; m_activatedModuleBase.Activated(); #if UNITY_2017_1_OR_NEWER Application.onBeforeRender += BeforeRenderUpdateModule; #else Camera.onPreCull += OnCameraPreCull; #endif InvokeActiveModuleChangedEvent(m_activatedModule); }