Class Condition
Base class for conditions stored directly within RuleSO using [SerializeReference]. Conditions are serialized inline and don't create separate assets.
Inheritance
Inherited Members
Namespace: Serenity.ProceduralAnimator.Infrastructure.Conditions
Assembly: Serenity.UnityProceduralAnimator.Infrastructure.dll
Syntax
public abstract class Condition
Remarks
Intentionally Unity-only: this class relies on Unity [SerializeReference] polymorphic serialization and UnityStateKey asset references. The condition tree shape is Unity-specific serialization, not a behavior contract worth porting generically for v1, so it has no Business port.
Constructors
Condition()
Declaration
protected Condition()
Properties
DisplayName
Gets the display name for this condition type (used in dropdown).
Declaration
public abstract string DisplayName { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
IsMet(in UnityProceduralContext)
Evaluates whether this condition is currently met.
Declaration
public abstract 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. |
Reset()
Resets any internal state (e.g., hysteresis tracking). Called when the animator is initialized or reset.
Declaration
public virtual void Reset()
Validate()
Validates the condition configuration.
Declaration
public virtual string Validate()
Returns
| Type | Description |
|---|---|
| string | Error message if invalid, null if valid. |