Dispose() public method

public Dispose ( ) : void
return void
示例#1
0
        public void CleanupUntouchedEditors()
        {
            if (m_EditorCache != null)
            {
                List <Object> toDelete = new List <Object>();
                foreach (Object key in m_EditorCache.Keys)
                {
                    if (!m_UsedEditors.ContainsKey(key))
                    {
                        toDelete.Add(key);
                    }
                }

                foreach (Object key in toDelete)
                {
                    EditorWrapper ew = m_EditorCache[key];
                    m_EditorCache.Remove(key);

                    if (ew == null)
                    {
                        continue;
                    }
                    ew.Dispose();
                }
            }

            m_UsedEditors.Clear();
        }
示例#2
0
        public void CleanupUntouchedEditors()
        {
            List <UnityEngine.Object> list = new List <UnityEngine.Object>();

            foreach (UnityEngine.Object current in m_EditorCache.Keys)
            {
                if (!m_UsedEditors.ContainsKey(current))
                {
                    list.Add(current);
                }
            }
            if (m_EditorCache != null)
            {
                foreach (UnityEngine.Object current2 in list)
                {
                    EditorWrapper editorWrapper = m_EditorCache[current2];
                    m_EditorCache.Remove(current2);
                    if (editorWrapper != null)
                    {
                        editorWrapper.Dispose();
                    }
                }
            }
            m_UsedEditors.Clear();
        }
示例#3
0
        public void CleanupUntouchedEditors()
        {
            List <UnityEngine.Object> list = new List <UnityEngine.Object>();

            foreach (UnityEngine.Object obj2 in this.m_EditorCache.Keys)
            {
                if (!this.m_UsedEditors.ContainsKey(obj2))
                {
                    list.Add(obj2);
                }
            }
            if (this.m_EditorCache != null)
            {
                foreach (UnityEngine.Object obj3 in list)
                {
                    EditorWrapper wrapper = this.m_EditorCache[obj3];
                    this.m_EditorCache.Remove(obj3);
                    if (wrapper != null)
                    {
                        wrapper.Dispose();
                    }
                }
            }
            this.m_UsedEditors.Clear();
        }
示例#4
0
        public void CleanupUntouchedEditors()
        {
            List <UnityEngine.Object> objectList = new List <UnityEngine.Object>();

            using (Dictionary <UnityEngine.Object, EditorWrapper> .KeyCollection.Enumerator enumerator = this.m_EditorCache.Keys.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    UnityEngine.Object current = enumerator.Current;
                    if (!this.m_UsedEditors.ContainsKey(current))
                    {
                        objectList.Add(current);
                    }
                }
            }
            if (this.m_EditorCache != null)
            {
                using (List <UnityEngine.Object> .Enumerator enumerator = objectList.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        UnityEngine.Object current       = enumerator.Current;
                        EditorWrapper      editorWrapper = this.m_EditorCache[current];
                        this.m_EditorCache.Remove(current);
                        if (editorWrapper != null)
                        {
                            editorWrapper.Dispose();
                        }
                    }
                }
            }
            this.m_UsedEditors.Clear();
        }
 public static EditorWrapper Make(UnityEngine.Object obj, EditorFeatures requirements)
 {
   EditorWrapper editorWrapper = new EditorWrapper();
   if (editorWrapper.Init(obj, requirements))
     return editorWrapper;
   editorWrapper.Dispose();
   return (EditorWrapper) null;
 }
示例#6
0
 public static EditorWrapper Make(UnityEngine.Object obj, EditorFeatures requirements)
 {
     EditorWrapper wrapper = new EditorWrapper();
     if (wrapper.Init(obj, requirements))
     {
         return wrapper;
     }
     wrapper.Dispose();
     return null;
 }
示例#7
0
        public static EditorWrapper Make(UnityEngine.Object obj, EditorFeatures requirements)
        {
            EditorWrapper wrapper = new EditorWrapper();

            if (wrapper.Init(obj, requirements))
            {
                return(wrapper);
            }
            wrapper.Dispose();
            return(null);
        }
示例#8
0
 public void OnDisable()
 {
     EditorApplication.update -= Update;
     if (m_PreviewEditor != null)
     {
         m_PreviewEditor.Dispose();
         m_PreviewEditor = null;
     }
     if (m_PreviewObject != null)
     {
         m_PreviewObject = null;
     }
     AssetStoreUtils.UnRegisterDownloadDelegate(this);
 }
示例#9
0
        static public EditorWrapper Make(Object obj, EditorFeatures requirements)
        {
            EditorWrapper cp = new EditorWrapper();

            if (cp.Init(obj, requirements))
            {
                return(cp);
            }
            else
            {
                cp.Dispose();
                return(null);
            }
        }
示例#10
0
        public static EditorWrapper Make(UnityEngine.Object obj, EditorFeatures requirements)
        {
            EditorWrapper editorWrapper = new EditorWrapper();
            EditorWrapper result;

            if (editorWrapper.Init(obj, requirements))
            {
                result = editorWrapper;
            }
            else
            {
                editorWrapper.Dispose();
                result = null;
            }
            return(result);
        }