logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class HudAnimationLayerEditorGui

    Draws the inline step editor for a HUD element animation's assigned procedural layer: its steps (scale or activation) and its phasing — the layer reference itself is drawn by the always-visible Layer row in HudElementAnimationListGui, above both this editor and the gallery it replaces. Drawn in the row INSTEAD of HudElementAnimationListGui's "Choose an animation" gallery once a layer is assigned, and collapsible so a HUD with several animated elements does not turn into a wall of step rows.

    Inheritance
    object
    HudAnimationLayerEditorGui
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.GameUi.Infrastructure.Editor.Builder
    Assembly: Serenity.UnityGameUi.Infrastructure.Editor.dll
    Syntax
    public static class HudAnimationLayerEditorGui
    Remarks

    Collapsed state is kept in a dictionary keyed by property path, the same idiom HudElementListGui uses for which detail tab an element is showing — session-only, not serialized onto the asset, since which rows happen to be open is a property of the editing session.

    Every write to the layer's own fields (steps, phase mode, repeat count, transform id) goes through HudAnimationSequenceLayerInspector's cached foreign UnityEditor.SerializedObject — this is a second object entirely from the HUD asset the rest of the row edits, so it cannot piggy-back on the HUD's own serializedObject.ApplyModifiedProperties(). This is the per-field write path — a continuous drag on a duration slider fires many repaints — so it goes through ApplyPendingEdits(ProceduralLayerSO): ApplyModifiedProperties + SetDirty only, the same "dirty asset, saved on the editor's next project save" flow any ordinary inspector field uses. It deliberately skips both UnityEditor.Undo.RecordObject(UnityEngine.Object,System.String) (already covered by ApplyModifiedProperties's own Undo integration) and UnityEditor.AssetDatabase.SaveAssets (which synchronously flushes every dirty asset in the whole project, and must not run once per drag frame). UnityEditor.EditorGUI.BeginChangeCheck/EndChangeCheck still batches the call to once per repaint that actually changed something, rather than once per field read. The full Undo.RecordObject → ApplyModifiedProperties → SetDirty → SaveAssets sequence (ApplyAndSave(ProceduralLayerSO, string)) is reserved for discrete one-click actions elsewhere — the template gallery's "Create" button and the transformId "fix" button — not for this per-field path.

    The ABSOLUTE-phase and repeatCount==0 warnings live here, next to the phase/repeat controls that cause them. The transformId-divergence warning stays on HudElementAnimationListGui: that one is about the watched-element reference, not about steps, and moving it here would separate it from the "Point layer at" fix button's own context (the row header, which this editor does not draw).

    Methods

    Draw(SerializedProperty)

    Draws the step editor for a layer already assigned by the row above — the Layer field itself now lives in HudElementAnimationListGui so it stays visible whether or not a layer is assigned — when the assigned layer is a recognized sequence kind, or a muted explanation when it is not (e.g. a material-colour or bone layer dragged into that field directly rather than created from a template).

    Declaration
    public static void Draw(SerializedProperty layerProperty)
    Parameters
    Type Name Description
    SerializedProperty layerProperty

    The animation row's layer property; must currently hold a non-null reference — the caller only reaches this method once a layer is assigned.

    In this article
    © 2026 Serenity. All Rights Reserved