Class CreateHudWindow
Creates a new HUD or edits an existing one: elements, their placement, what each reads and how it is drawn.
Namespace: Serenity.GameUi.Infrastructure.Editor.Builder
Assembly: Serenity.UnityGameUi.Infrastructure.Editor.dll
Syntax
public sealed class CreateHudWindow : EditorWindow
Remarks
Collects input and renders results only; HudCreator does every asset mutation. Editing happens on a scratch instance so nothing is written to disk until the button is pressed, the same trick the modal and feedback builders use to reuse the real inspector GUI inside a wizard.
Built as a stepped wizard on Serenity.Global.Infrastructure.Editor.SerenityWizardGui like every other Serenity builder, with the elements shown one at a time beside a list of them. A HUD is a set of near-identical entries of about twenty fields each; laid out end to end they read as a wall, and the wall grows with the project.
Constructors
CreateHudWindow()
Declaration
public CreateHudWindow()
Methods
ShowForAsset(string, string, string)
Opens the builder on the HUD at a project path, focused on one element.
Declaration
public static void ShowForAsset(string assetPath, string elementId, string section)
Parameters
| Type | Name | Description |
|---|---|---|
| string | assetPath | Project path of the HUD asset. |
| string | elementId | Id of the element to select; empty selects the first. |
| string | section | Section name to open, from HudDefinitionScanner.Sections. |
Remarks
Takes a path rather than the asset so a caller outside this aggregate — the project-wide validator report, which knows only what a finding carries — does not have to reference the GameUi runtime assembly just to name a type it never otherwise touches.
ShowForExisting(UnityHudDefinition)
Opens the builder already editing an existing HUD.
Declaration
public static void ShowForExisting(UnityHudDefinition hud)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityHudDefinition | hud | The HUD to load. |
ShowForExisting(UnityHudDefinition, string, string)
Opens the builder on an existing HUD with one element already selected and the group of fields at fault already showing.
Declaration
public static void ShowForExisting(UnityHudDefinition hud, string elementId, string section)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityHudDefinition | hud | The HUD to load. |
| string | elementId | Id of the element to select; empty selects the first. |
| string | section | Section name to open, from HudDefinitionScanner.Sections. |
Remarks
This is what turns a finding in a project-wide report into a link: the report knows which element and which section, and those are exactly the two coordinates this window navigates by.
ShowWindow()
Declaration
public static void ShowWindow()