Пример #1
0
        protected virtual void Dispose(bool disposing)
        {
            if (disposed)
            {
                return;
            }

            if (disposing)
            {
                UIRUtility.Destroy(atlas);
                atlas = null;

                if (m_Allocator != null)
                {
                    m_Allocator.Dispose();
                    m_Allocator = null;
                }

                if (m_Blitter != null)
                {
                    m_Blitter.Dispose();
                    m_Blitter = null;
                }
            }
            else
            {
                UnityEngine.UIElements.DisposeHelper.NotifyMissingDispose(this);
            }

            disposed = true;
        }
Пример #2
0
        protected virtual void Dispose(bool disposing)
        {
            s_Instances.Remove(this);

            if (disposed)
            {
                return;
            }

            if (disposing)
            {
                UIRUtility.Destroy(atlas);
                atlas = null;

                UIRUtility.Destroy(m_BlitMaterial);
                m_BlitMaterial = null;

                if (m_Allocator != null)
                {
                    m_Allocator.Dispose();
                    m_Allocator = null;
                }

                if (atlasManagerDisposed != null)
                {
                    atlasManagerDisposed(this);
                }
            }
            else
            {
                UnityEngine.UIElements.DisposeHelper.NotifyMissingDispose(this);
            }

            disposed = true;
        }