protected virtual void OnDisable() { graph.onExposedParameterListChanged -= UpdateExposedParameters; graph.onExposedParameterModified -= UpdateExposedParameters; exposedParameterFactory?.Dispose(); // Graphs that created in GraphBehaviour sometimes gives null ref. exposedParameterFactory = null; }
protected virtual void OnEnable() { graph = target as BaseGraph; graph.onExposedParameterListChanged += UpdateExposedParameters; graph.onExposedParameterModified += UpdateExposedParameters; if (exposedParameterFactory == null) { exposedParameterFactory = new ExposedParameterFieldFactory(graph); } }