Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Condition<T>

The base class for user-accessible conditions holding a value of type T.
Read time 1 minuteLast updated 6 days ago

Definition

public abstract class Condition<T> : Condition, ICondition

Remarks

Inherit from this class to define a custom condition type. The Condition<T>.Value field is serialized with the state machine and is displayed and edited in the transition inspector. To read the condition back from an asset, for example in an importer, cast the ICondition to the concrete derived type and read Condition<T>.Value and Condition<T>.Comparison. For a condition without a value, derive from Condition instead.

Fields

Value

Description

ValueThe value of the condition.

Properties

Property

Description

ComparisonThe comparison operator applied to the condition's value.
DisplayComparisonDropdownWhether the transition inspector displays a dropdown to select the condition's comparison operator.
SupportedComparisonsThe comparison operators offered by the comparison dropdown.

Inheritance