# Condition<T>

> The base class for user-accessible conditions holding a value of type T.

## Definition

* **Type:** Class
* **Namespace:** [Unity.GraphToolkit.Editor](/engine/6000.7/script-reference/unity/graphtoolkit/editor.md)
* **Assembly:** UnityEditor
* **Inherits from:** [Condition](/engine/6000.7/script-reference/unity/graphtoolkit/editor/condition.md)
* **Implements:** [ICondition](/engine/6000.7/script-reference/unity/graphtoolkit/editor/icondition.md)

```csharp
public abstract class Condition<T> : Condition, ICondition
```

## Remarks

Inherit from this class to define a custom condition type. The [Condition\<T>.Value](/engine/6000.7/script-reference/unity/graphtoolkit/editor/condition1/value.md) 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](/engine/6000.7/script-reference/unity/graphtoolkit/editor/icondition.md) to the concrete derived type and read [Condition\<T>.Value](/engine/6000.7/script-reference/unity/graphtoolkit/editor/condition1/value.md) and [Condition\<T>.Comparison](/engine/6000.7/script-reference/unity/graphtoolkit/editor/condition1/comparison.md). For a condition without a value, derive from [Condition](/engine/6000.7/script-reference/unity/graphtoolkit/editor/condition.md) instead.

## Fields

| Value                                                                                  | Description                 |
| -------------------------------------------------------------------------------------- | --------------------------- |
| [Value](/engine/6000.7/script-reference/unity/graphtoolkit/editor/condition1/value.md) | The value of the condition. |

## Properties

| Property                                                                                                                       | Description                                                                                         |
| ------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------- |
| [Comparison](/engine/6000.7/script-reference/unity/graphtoolkit/editor/condition1/comparison.md)                               | The comparison operator applied to the condition's value.                                           |
| [DisplayComparisonDropdown](/engine/6000.7/script-reference/unity/graphtoolkit/editor/condition1/displaycomparisondropdown.md) | Whether the transition inspector displays a dropdown to select the condition's comparison operator. |
| [SupportedComparisons](/engine/6000.7/script-reference/unity/graphtoolkit/editor/condition1/supportedcomparisons.md)           | The comparison operators offered by the comparison dropdown.                                        |

## Inheritance

**Inherited Members:**

* [Condition.CreateGroupCondition()](/engine/6000.7/script-reference/unity/graphtoolkit/editor/condition/creategroupcondition.md)
* [Condition.CreateVariableCondition(IVariable, Object, ConditionComparison)](/engine/6000.7/script-reference/unity/graphtoolkit/editor/condition/createvariablecondition.md)
* [Condition.ID()](/engine/6000.7/script-reference/unity/graphtoolkit/editor/condition/id.md)
* [Condition.Rule()](/engine/6000.7/script-reference/unity/graphtoolkit/editor/condition/rule.md)
* [Condition.StateMachine()](/engine/6000.7/script-reference/unity/graphtoolkit/editor/condition/statemachine.md)
* [Condition.Icon()](/engine/6000.7/script-reference/unity/graphtoolkit/editor/condition/icon.md)
* [Condition.Title()](/engine/6000.7/script-reference/unity/graphtoolkit/editor/condition/title.md)
* [Condition.Tooltip()](/engine/6000.7/script-reference/unity/graphtoolkit/editor/condition/tooltip.md)
