Class ThresholdCondition
Condition that triggers when a state value crosses a threshold. Uses hysteresis to prevent flickering between states.
Inherited Members
Namespace: Serenity.ProceduralExpression.Infrastructure.Conditions
Assembly: Serenity.UnityProceduralExpression.Infrastructure.dll
Syntax
public class ThresholdCondition : Condition
Constructors
ThresholdCondition()
Declaration
public ThresholdCondition()
Fields
enterThreshold
Declaration
public float enterThreshold
Field Value
| Type | Description |
|---|---|
| float |
exitThreshold
Declaration
public float exitThreshold
Field Value
| Type | Description |
|---|---|
| float |
invertLogic
Declaration
public bool invertLogic
Field Value
| Type | Description |
|---|---|
| bool |
stateKey
Declaration
public UnityStateKey stateKey
Field Value
| Type | Description |
|---|---|
| UnityStateKey |
Properties
DisplayName
Gets the display name for this condition type (used in dropdown).
Declaration
public override string DisplayName { get; }
Property Value
| Type | Description |
|---|---|
| string |
Overrides
Methods
IsMet(in UnityProceduralContext)
Evaluates whether this condition is currently met.
Declaration
public override bool IsMet(in UnityProceduralContext ctx)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityProceduralContext | ctx | The procedural context containing state and time information. |
Returns
| Type | Description |
|---|---|
| bool | True if the condition is met, false otherwise. |
Overrides
Reset()
Resets any internal state (e.g., hysteresis tracking). Called when the animator is initialized or reset.
Declaration
public override void Reset()
Overrides
Validate()
Validates the condition configuration.
Declaration
public override string Validate()
Returns
| Type | Description |
|---|---|
| string | Error message if invalid, null if valid. |