logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class RuleSO

    ScriptableObject defining a rule that connects conditions to layer weights or action triggers. Rules are evaluated in priority order (highest first). Conditions are configured inline using the [SerializeReference] pattern.

    Inheritance
    object
    RuleSO
    Namespace: Serenity.ProceduralExpression.Infrastructure.Rules
    Assembly: Serenity.UnityProceduralExpression.Infrastructure.dll
    Syntax
    public class RuleSO : ScriptableObject

    Constructors

    RuleSO()

    Declaration
    public RuleSO()

    Properties

    AllowRetrigger

    Declaration
    public bool AllowRetrigger { get; }
    Property Value
    Type Description
    bool

    BlendInSeconds

    Declaration
    public float BlendInSeconds { get; }
    Property Value
    Type Description
    float

    BlendOutSeconds

    Declaration
    public float BlendOutSeconds { get; }
    Property Value
    Type Description
    float

    CooldownSeconds

    Declaration
    public float CooldownSeconds { get; }
    Property Value
    Type Description
    float

    Effect

    Declaration
    public RuleEffect Effect { get; }
    Property Value
    Type Description
    RuleEffect

    Priority

    Declaration
    public int Priority { get; }
    Property Value
    Type Description
    int

    RuleCondition

    Declaration
    public Condition RuleCondition { get; }
    Property Value
    Type Description
    Condition

    TargetAction

    Declaration
    public ProceduralActionSO TargetAction { get; }
    Property Value
    Type Description
    ProceduralActionSO

    TargetLayer

    Declaration
    public ProceduralLayerSO TargetLayer { get; }
    Property Value
    Type Description
    ProceduralLayerSO

    WeightProvider

    Declaration
    public WeightProviderSO WeightProvider { get; }
    Property Value
    Type Description
    WeightProviderSO

    Methods

    GetMappedWeight(in UnityProceduralContext)

    Gets the layer weight from the weight provider.

    Declaration
    public float GetMappedWeight(in UnityProceduralContext ctx)
    Parameters
    Type Name Description
    UnityProceduralContext ctx
    Returns
    Type Description
    float

    IsConditionMet(in UnityProceduralContext)

    Evaluates whether this rule's condition is currently met.

    Declaration
    public bool IsConditionMet(in UnityProceduralContext ctx)
    Parameters
    Type Name Description
    UnityProceduralContext ctx
    Returns
    Type Description
    bool

    ResetCondition()

    Resets the condition's internal state.

    Declaration
    public void ResetCondition()

    ValidateConfiguration()

    Validates the rule configuration and returns any issues found.

    Declaration
    public string ValidateConfiguration()
    Returns
    Type Description
    string
    In this article
    © 2026 Serenity. All Rights Reserved