logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Namespace Serenity.ProceduralAnimator.Infrastructure.ProceduralLayers

    Classes

    ActivationSequenceLayerSO

    Procedural layer that toggles a GameObject on/off through a sequence of activation steps. Applies activation changes via ActivationDelta for per-instance one-shot or repeating on/off sequences (e.g. muzzle flash meshes, telegraph indicators, a weapon's spark effect).

    Weight is a gate, not a blend. Unlike other sequence layers, activation is a boolean — blending it makes no sense. If weight <= 0.001f this layer contributes nothing to the ActivationDelta; otherwise it contributes its current step's active value verbatim, with no lerp/interpolation. Blend-in/blend-out timing on the controlling Rule is therefore meaningless for this layer kind — weight only gates whether the layer contributes, it never blends the boolean itself.

    AimDirectionLayerSO

    Stateless procedural layer that drives target-aware aim: reads signed, normalized pitch/yaw state keys and writes per-bone chest/neck/head/upper-arm rotation offsets via the pure AimDistributionSolver. The yaw lead on the head/chest (snapping toward the target while the whole body's yaw catches up via EnemyBehaviorController.ApplyFacing) is the highest-impact visual change this layer contributes.

    Mechanism: every bone offset is a deterministic function of the current pitch/yaw state — no per-instance runtime state on this shared asset. Pitch/yaw are written by the controller each frame from the chest bone's world position, so this layer never touches world space itself.

    DirectionalLeanLayerSO

    Stateless procedural layer that drives a constant (non-oscillating) postural lean from the current travel direction: the chest and hips pitch forward while advancing and lean back (more pronounced) while retreating, both roll into the direction of a lateral strafe, and the head yaws slightly toward the strafe direction. Reads the same directional state keys as GaitCycleLayerSO (dirForwardKey/dirLateralKey) but is a separate layer/asset because this offset is not part of the periodic stride cycle — it has no phase input and applies to different bones (Chest/Hips/Head rather than the leg chain).

    Mechanism: every bone offset is a deterministic function of the current direction state — no per-instance runtime state on this shared asset — via the pure SolveLean(double, double, double, double, double, double).

    Common applications: selling forward/backward/strafe travel direction on a humanoid whose gait cycle alone (antiphase leg swing) reads identically for forward and backward motion.

    GaitCycleLayerSO

    Stateless procedural layer that drives a walking gait cycle: reads a normalized, wrapping phase state key and writes per-bone leg/arm/hip rotation offsets (plus a hip vertical bob) via the pure GaitCycleSolver.

    Mechanism: every bone offset is a deterministic function of the current phase — there is no per-instance runtime state on this asset (it is shared across every enemy instance), so the only "memory" of where an enemy is in its stride lives in the phase state key itself, written by the controller (EnemyBehaviorController's distance accumulator).

    Common applications: humanoid walk/run cycles driven by real traversed distance rather than elapsed time, so stride speed always matches locomotion speed.

    GraphicColorSequenceLayerSO

    Procedural layer that animates through a sequence of UGUI Graphic tint steps. Applies tint changes via UiColorDelta for per-instance HUD fade/flash/tint animation, applied by UnityGraphicColorApplier.

    Common applications: a fade-in entrance, a damage/heal flash, an ambient "still alive" alpha pulse.

    HighFrequencyNoiseLayerSO

    Procedural layer that applies high-frequency stochastic noise to target bones.

    Mechanism: Combines high-frequency sine waves with Perlin noise modulation to create rapid, irregular jitter patterns on target bones.

    Common applications: Trembling effects, vibration, jitter, instability visualization.

    MaterialColorSequenceLayerSO

    Procedural layer that animates through a sequence of color steps. Applies color changes via MaterialDelta for per-instance animation using MaterialPropertyBlock.

    Common applications: Pulsing effects, damage flashes, status indicators, ambient color cycling.

    PeriodicOscillationLayerSO

    Procedural layer that applies sine-wave periodic oscillation to target bones.

    Mechanism: Generates smooth, continuous periodic motion using a sine wave function. The oscillation can affect both position and rotation of target bones.

    Common applications: Idle motion, breathing effects, bobbing objects, pulsing UI elements.

    PerlinDriftLayerSO

    Procedural layer that applies low-frequency Perlin noise drift to target bones.

    Mechanism: Uses Perlin noise to generate smooth, organic, slow-moving rotational offsets. Each bone can have independent noise sampling for natural variation.

    Common applications: Idle motion, floating objects, gentle swaying, ambient movement.

    ProceduralLayerFacets

    Single source of truth for facet-level questions about a ProceduralLayerSO — finer-grained than DrivenChannels's channel mask, which only tells "Transform" (scale, rotation OR position all set that one flag).

    ProceduralLayerSO

    Base ScriptableObject for continuous procedural animation layers. Layers are evaluated every frame and contribute weighted offsets to the final pose and/or material properties. Examples: breathing, sway, tremor, arm hang, head twitch, color pulsing.

    RandomImpulseLayerSO

    Procedural layer that applies random impulse events to a target bone.

    Mechanism: Triggers discrete rotation impulses at randomized intervals, with configurable animation curves for smooth onset/offset.

    Common applications: Random motion, discrete events, sporadic activity, attention shifts.

    StateModulatedOffsetLayerSO

    Procedural layer that applies static rotation offsets to target bones, scaled by a state value.

    Mechanism: Each configured bone group receives a fixed rotation offset that is multiplied by the state intensity and layer weight. Supports paired bones with mirrored Z-axis and optional asymmetry.

    Common applications: Gravity-based deformation, pose adjustments, state-driven offsets.

    TransformPositionSequenceLayerSO

    Procedural layer that animates through a sequence of local-position-offset steps. Applies position changes via TransformDelta for per-instance animation.

    Common applications: a slide-in entrance, a shake/nudge reaction, anything that needs to actually move rather than scale or spin.

    TransformRotationSequenceLayerSO

    Procedural layer that animates through a sequence of local-Z-rotation steps. Applies rotation changes via TransformDelta for per-instance animation.

    Common applications: wiggle/shake reactions, a retro spinning pickup icon, rumble/jitter.

    TransformScaleSequenceLayerSO

    Procedural layer that animates through a sequence of scale steps. Applies scale changes via TransformDelta for per-instance animation.

    Common applications: Pulsing objects, breathing effects, impact squash/stretch.

    Structs

    ActivationSequenceLayerSO.ActivationStep

    Represents a single step in the activation sequence.

    GraphicColorSequenceLayerSO.ColorStep

    Represents a single step in the tint sequence.

    MaterialColorSequenceLayerSO.ColorStep

    Represents a single step in the color sequence.

    TransformPositionSequenceLayerSO.PositionStep

    Represents a single step in the position sequence.

    TransformRotationSequenceLayerSO.RotationStep

    Represents a single step in the rotation sequence.

    TransformScaleSequenceLayerSO.ScaleStep

    Represents a single step in the scale sequence.

    Enums

    LayerPhaseMode

    Governs how a ProceduralLayerSO derives the clock it uses to drive its own phase/step progression.

    ProceduralChannels

    The procedural evaluation channels a ProceduralLayerSO can write to — one per delta type on ProceduralLayerSO's stacked Evaluate overloads. A FlagsAttribute enum so a layer can declare more than one channel if it ever needs to; every concrete layer in this codebase today writes exactly one.

    In this article
    © 2026 Serenity. All Rights Reserved