UnityEditor.ColorPicker.OnDestroy C# (CSharp) Method

OnDestroy() public method

public OnDestroy ( ) : void
return void
        public void OnDestroy()
        {
            Undo.CollapseUndoOperations(this.m_ModalUndoGroup);
            if (this.m_ColorSlider != null)
            {
                UnityEngine.Object.DestroyImmediate(this.m_ColorSlider);
            }
            if (this.m_ColorBox != null)
            {
                UnityEngine.Object.DestroyImmediate(this.m_ColorBox);
            }
            if (this.m_RTexture != null)
            {
                UnityEngine.Object.DestroyImmediate(this.m_RTexture);
            }
            if (this.m_GTexture != null)
            {
                UnityEngine.Object.DestroyImmediate(this.m_GTexture);
            }
            if (this.m_BTexture != null)
            {
                UnityEngine.Object.DestroyImmediate(this.m_BTexture);
            }
            if (this.m_HueTexture != null)
            {
                UnityEngine.Object.DestroyImmediate(this.m_HueTexture);
            }
            if (this.m_SatTexture != null)
            {
                UnityEngine.Object.DestroyImmediate(this.m_SatTexture);
            }
            if (this.m_ValTexture != null)
            {
                UnityEngine.Object.DestroyImmediate(this.m_ValTexture);
            }
            if (this.m_AlphaTexture != null)
            {
                UnityEngine.Object.DestroyImmediate(this.m_AlphaTexture);
            }
            s_SharedColorPicker = null;
            if (this.m_IsOSColorPicker)
            {
                OSColorPicker.Close();
            }
            EditorApplication.update = (EditorApplication.CallbackFunction) Delegate.Remove(EditorApplication.update, new EditorApplication.CallbackFunction(this.PollOSColorPicker));
            if (this.m_ColorLibraryEditorState != null)
            {
                this.m_ColorLibraryEditorState.TransferEditorPrefsState(false);
            }
            if (this.m_ColorLibraryEditor != null)
            {
                this.m_ColorLibraryEditor.UnloadUsedLibraries();
            }
        }