Exemple #1
0
    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;
            }
        }
    }
        /// <summary>
        /// Destroys the given UI System
        /// </summary>
        /// <param name="system">The UI System to be destroyed</param>
        public static void DestroyUISystem(UISystem system)
        {
            Instance.m_UISystems.Remove(system);
            system.Dispose();

            if (Instance.m_UISystems.Count == 0)
            {
                // TODO: Means for recreating the log handler
                Instance.m_LogHandler.Dispose();
                Instance.m_LogHandler = null;
            }
        }
    void OnApplicationQuit()
    {
        if (m_UISystem != null)
        {
            if (UISystemDestroying != null)
            {
                UISystemDestroying();
            }

            m_UISystem.Uninitialize();
            m_SystemListener.Dispose();
            m_UISystem.Dispose();
            m_UISystem = null;
        }
    }