Version: Unity 6.7 Beta (6000.7)
LanguageEnglish
  • C#

ConditionView<T0>.OnConditionChanged

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public void OnConditionChanged();

Description

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

Fires after an edit recorded through StateMachine.UndoBeginRecordStateMachine and StateMachine.UndoEndRecordStateMachine is applied to ConditionView<T0>.Condition — 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<T0>.OnViewBuilt so it reflects the condition's current data. Unlike ConditionView<T0>.OnViewBuilt, this can fire many times over the view's lifetime.

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