logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class SerenityHudBindingValidator

    Checks every authored HUD: that each element's bindings still resolve, that representations needing a maximum have one, that ids are unique, and that the asset is actually reachable at runtime through Addressables.

    Inheritance
    object
    SerenityHudBindingValidator
    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.Validation
    Assembly: Serenity.UnityGameUi.Infrastructure.Editor.dll
    Syntax
    public static class SerenityHudBindingValidator
    Remarks

    HUD bindings are reflection over member names, so they rot silently — rename a property and the element simply shows its fallback text forever, with nothing in the console. This turns that into a finding.

    The rules themselves live in HudDefinitionScanner, shared with the builder window's pre-write check and its inline hints, so a HUD cannot be judged one way here and another way while it is being authored. This class supplies only what a project scan knows and a pure scanner cannot: which assets exist, and how to reach a directly-referenced source object.

    The Addressables-registration check is genuinely new here rather than delegated to the generic Serenity.Global.Infrastructure.Editor.Validation.SerenityAddressableTagValidator: that validator only judges assets under Assets/Serenity/Assets/Plugins/Serenity, and the HUD Builder's default output folder (Assets/Media/GeneratedHuds) sits outside both — a HUD created there and never registered would otherwise pass every project validator while still being unreachable at runtime through UnityHudDefinitionProvider.

    Fields

    ValidatorName

    Validator tag used on issues and in the report's validators-run list.

    Declaration
    public const string ValidatorName = "hudBindings"
    Field Value
    Type Description
    string

    Methods

    AppendMissingInstallTaskIssue(SerenityValidationReport, bool, bool, string)

    Reports the one thing that makes every authored HUD invisible at once: no initialization pipeline profile runs the install task, so nothing registers IGameUiService or IHudDefinitionProvider at boot.

    Declaration
    public static void AppendMissingInstallTaskIssue(SerenityValidationReport report, bool anyHudExists, bool anyProfileRunsInstallTask, string installTaskPath)
    Parameters
    Type Name Description
    SerenityValidationReport report
    bool anyHudExists
    bool anyProfileRunsInstallTask
    string installTaskPath
    Remarks

    Raised once for the project rather than once per HUD — it is a single fact about the pipeline, and repeating it per asset would bury the real per-HUD findings under copies of it. The issue is anchored to the install task asset itself when one exists, because that asset is what the author has to drag into a profile.

    Nothing is raised when the project has no HUD to show: a project not using the module has no reason to run the task, and saying otherwise would be noise everywhere.

    Both facts arrive as parameters rather than being gathered here, so the emission rules can be tested against every combination instead of against whatever the real project happens to ship.

    Run(SerenityValidationReport)

    Runs the HUD scan and appends findings to the report.

    Declaration
    public static void Run(SerenityValidationReport report)
    Parameters
    Type Name Description
    SerenityValidationReport report

    The report to append to.

    In this article
    © 2026 Serenity. All Rights Reserved