private void Start() { _lastTimeEvalFps = Time.realtimeSinceStartup; try { Assert.IsNotNull(_settings); if (_settings.AdaptiveFrameRate) { QualitySettings.vSyncCount = 0; } AXRServerPlugin.SetLicenseFile(Application.isEditor ? "Assets/onAirXR/Server/Editor/Misc/noncommercial.license" : _settings.License); AXRServerPlugin.SetVideoEncoderParameters(120.0f, GroupOfPictures); int startupResult = AXRServerPlugin.Startup(_settings.MaxClientCount, _settings.StapPort, _settings.AmpPort, _settings.LoopbackOnly, AudioSettings.outputSampleRate); if (startupResult == 0) // no error { var pluginPtr = IntPtr.Zero; AXRServerPlugin.GetPluginPtr(ref pluginPtr); AXRServerPlugin.SetPluginPtr(pluginPtr); GL.IssuePluginEvent(AXRServerPlugin.Startup_RenderThread_Func, 0); _startedUp = true; switch (_settings.Profiler) { case "full": AXRServerPlugin.EnableProfiler(ProfilerFrame | ProfilerReport); break; case "frame": AXRServerPlugin.EnableProfiler(ProfilerFrame); break; case "report": AXRServerPlugin.EnableProfiler(ProfilerReport); break; default: break; } Debug.Log("[onAirXR] INFO: The onAirXR Server has started on port " + _settings.StapPort + "."); } else { string reason; switch (startupResult) { case StartupErrorNotSupportingGPU: reason = "Graphic device is not supported"; break; case StartupErrorLicenseNotYetVerified: reason = "License is not yet verified"; break; case StartupErrorLicenseFileNotFound: reason = "License file not found"; break; case StartupErrorInvalidLicenseFile: reason = "Invalid license file"; break; case StartupErrorLicenseExpired: reason = "License expired"; break; default: reason = "Unknown error occurred"; break; } Debug.LogError("[onAirXR] ERROR: Failed to startup : " + reason); if (_Delegate != null) { _Delegate.AirXRServerFailed(reason); } } } catch (System.DllNotFoundException) { if (_Delegate != null) { _Delegate.AirXRServerFailed("Failed to load onAirXR server plugin"); } } }