UnityEditor.EditorWrapper.Dispose C# (CSharp) Method

Dispose() public method

public Dispose ( ) : void
return void
        public void Dispose()
        {
            if (this.editor != null)
            {
                this.OnSceneDrag = null;
                UnityEngine.Object.DestroyImmediate(this.editor);
                this.editor = null;
            }
            GC.SuppressFinalize(this);
        }

Usage Example

示例#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();
        }
All Usage Examples Of UnityEditor.EditorWrapper::Dispose