/// <summary> /// Creates a new ViewContext /// </summary> /// <param name="ctxSettings">Settings for the context</param> /// <param name="listener">Listener for events for the context</param> /// <param name="fileHandler">File handler for the context</param> /// <returns>the newly created ViewContext</returns> public static UISystem CreateUISystem(SystemSettings systemSettings) { if (Instance.m_UISystems.Count > 0) { Debug.LogWarning("You can only create one UISystem. " + "Creation of second CoherentGTSystem will fail!"); return(null); } Instance.m_LogHandler = new UnityGTLogHandler(); SetDependenciesPath(); var uiSystem = CoherentUIGT_Native.InitializeUIGTSystem( Coherent.UIGT.License.COHERENT_KEY, systemSettings, Severity.Debug, Instance.m_LogHandler, null); uiSystem.SetUnityPluginListener(UnityPluginListener); Instance.m_UISystems.Add(uiSystem); RestoreProcessPath(); return(uiSystem); }
void OnApplicationQuit() { if (UISystemDestroying != null) { UISystemDestroying(); } OnDestroy(); foreach (Texture textureAsset in m_PreloadedImageTextureAssetsInUse.Values) { Resources.UnloadAsset(textureAsset); } m_PreloadedImageTextureAssetsInUse.Clear(); foreach (RenderTexture renderTexture in m_LiveViewRenderTexturesForLateRelease.Values) { renderTexture.Release(); } m_LiveViewRenderTexturesForLateRelease.Clear(); if (m_UISystem != null) { CoherentUIGT_Native.UnityOnApplicationQuit(); m_UISystem.Dispose(); m_UISystem = null; if (m_LocalizationManager != null) { m_LocalizationManager.Dispose(); m_LocalizationManager = null; } } }
static void OnPlayModeChanged() { if (!EditorApplication.isPlaying) { try { CoherentUIGT_Native.UnityOnEditorStop(); } catch (System.TypeInitializationException) { // Ignore DLLNotFoundException when our library is not // yet loaded as then we don't have to send OnEditorStop event. } } }