public void OnDestroy()
{
Undo.CollapseUndoOperations(this.m_ModalUndoGroup);
if (this.m_ColorSlider)
{
UnityEngine.Object.DestroyImmediate(this.m_ColorSlider);
}
if (this.m_ColorBox)
{
UnityEngine.Object.DestroyImmediate(this.m_ColorBox);
}
if (this.m_RTexture)
{
UnityEngine.Object.DestroyImmediate(this.m_RTexture);
}
if (this.m_GTexture)
{
UnityEngine.Object.DestroyImmediate(this.m_GTexture);
}
if (this.m_BTexture)
{
UnityEngine.Object.DestroyImmediate(this.m_BTexture);
}
if (this.m_HueTexture)
{
UnityEngine.Object.DestroyImmediate(this.m_HueTexture);
}
if (this.m_SatTexture)
{
UnityEngine.Object.DestroyImmediate(this.m_SatTexture);
}
if (this.m_ValTexture)
{
UnityEngine.Object.DestroyImmediate(this.m_ValTexture);
}
if (this.m_AlphaTexture)
{
UnityEngine.Object.DestroyImmediate(this.m_AlphaTexture);
}
ColorPicker.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();
}
EditorPrefs.SetInt("CPickerHeight", (int)base.position.height);
}