protected void OnDisable() { if (graph != null) { graph.onExposedParameterListChanged -= UpdateParameters; graph.onExposedParameterModified -= UpdateParameters; graph.onExposedParameterValueChanged -= UpdateParameters; Undo.undoRedoPerformed -= UpdateParameters; } variant.variantTexturesUpdated -= UpdateIsDirtyAndPreview; MixtureVariant parent = variant.parentVariant; while (parent != null) { parent.parameterValueChanged -= UpdateParameters; parent = parent.parentVariant; } if (variantPreview != null) { variantPreview.Release(); variantPreview = null; } if (variantPreviewEditor != null) { DestroyImmediate(variantPreviewEditor); variantPreviewEditor = null; } exposedParameterFactory.Dispose(); }
protected virtual void OnDisable() { if (graph != null) { graph.onExposedParameterListChanged -= UpdateExposedParameters; graph.onExposedParameterModified -= UpdateExposedParameters; Undo.undoRedoPerformed -= UpdateExposedParameters; exposedParameterFactory.Dispose(); exposedParameterFactory = null; } if (defaultTextureEditor != null) { DestroyImmediate(defaultTextureEditor); } if (variantEditor != null) { DestroyImmediate(variantEditor); } }