# OnConditionChanged()

> Called after the condition's data changes and the built-in UI has refreshed to reflect it.

## Definition

* **Type:** Method
* **Namespace:** [Unity.GraphToolkit.Editor](/engine/6000.7/script-reference/unity/graphtoolkit/editor.md)
* **Assembly:** UnityEditor

```csharp
public virtual void OnConditionChanged()
```

### Remarks

Fires after an edit recorded through [StateMachine.UndoBeginRecordStateMachine](/engine/6000.7/script-reference/unity/graphtoolkit/editor/statemachine/undobeginrecordstatemachine.md) and [StateMachine.UndoEndRecordStateMachine](/engine/6000.7/script-reference/unity/graphtoolkit/editor/statemachine/undoendrecordstatemachine.md) is applied to [ConditionView\<T>.Condition](/engine/6000.7/script-reference/unity/graphtoolkit/editor/conditionview1/condition.md) — whether the edit came from the built-in UI (typing in the value field, picking a comparison operator) or from your own code. Override this to refresh custom UI you added in [ConditionView\<T>.OnViewBuilt](/engine/6000.7/script-reference/unity/graphtoolkit/editor/conditionview1/onviewbuilt.md) so it reflects the condition's current data. Unlike [ConditionView\<T>.OnViewBuilt](/engine/6000.7/script-reference/unity/graphtoolkit/editor/conditionview1/onviewbuilt.md), this can fire many times over the view's lifetime.

### Examples

```csharp
public override void OnConditionChanged()
{
    m_IconImage.image = Condition.Icon;
}
```
