public void OnDisable()
{
SceneView.onPreSceneGUIDelegate = (SceneView.OnSceneFunc) Delegate.Remove(SceneView.onPreSceneGUIDelegate, new SceneView.OnSceneFunc(this.OnPreSceneGUICallback));
this.m_BoxEditor.OnDisable();
Object.DestroyImmediate(this.m_ReflectiveMaterial);
Object.DestroyImmediate(this.m_CubemapEditor);
IEnumerator enumerator = this.m_CachedGizmoMaterials.Values.GetEnumerator();
try
{
while (enumerator.MoveNext())
{
Material current = (Material) enumerator.Current;
Object.DestroyImmediate(current);
}
}
finally
{
IDisposable disposable = enumerator as IDisposable;
if (disposable != null)
{
disposable.Dispose();
}
}
this.m_CachedGizmoMaterials.Clear();
}