Class UnityHudElementDefinition
Inheritance
UnityHudElementDefinition
Assembly: Serenity.UnityGameUi.Infrastructure.dll
Syntax
public class UnityHudElementDefinition : IHudElementDefinition, IFoundationSettings, IHudPlacedElement
Constructors
UnityHudElementDefinition()
Declaration
public UnityHudElementDefinition()
Properties
Anchor
Declaration
public UiAnchorType Anchor { get; }
Property Value
AnimationSettings
The configured animations, in their concrete form, for the view and the HUD host to read the
authored ProceduralAnimator layer from — the interface's own Animations only exposes
what the engine-agnostic scanner needs.
Declaration
public IReadOnlyList<UnityHudElementAnimation> AnimationSettings { get; }
Property Value
Animations
Declaration
public IReadOnlyList<IHudElementAnimationDefinition> Animations { get; }
Property Value
CapacityBinding
Declaration
public IHudBinding CapacityBinding { get; }
Property Value
CapacityBindingSettings
The capacity binding in its concrete form, or null when none is authored.
Declaration
public UnityHudBinding CapacityBindingSettings { get; }
Property Value
ChangeFeedbackCooldownSeconds
Minimum time between two change-feedback plays on this element, in seconds.
Declaration
public float ChangeFeedbackCooldownSeconds { get; }
Property Value
ChangeFeedbackDefinitionId
Declaration
public string ChangeFeedbackDefinitionId { get; }
Property Value
ChangeFeedbackDirection
Declaration
public HudValueChangeDirection ChangeFeedbackDirection { get; }
Property Value
Color
Colour applied to the element's text when the theme's is not used.
Declaration
public Color Color { get; }
Property Value
EvaluatesThresholdsAsCapacityRatio
Declaration
public bool EvaluatesThresholdsAsCapacityRatio { get; }
Property Value
Font
Typeface applied to the element's text when the theme's is not used; null keeps whatever
the created text object already had.
Declaration
public TMP_FontAsset Font { get; }
Property Value
| Type |
Description |
| TMP_FontAsset |
|
FontSize
Font size for the element's text; zero keeps the template's own.
Declaration
public float FontSize { get; }
Property Value
GrowDirection
Declaration
public HudGrowDirection GrowDirection { get; }
Property Value
Guid
Declaration
public string Guid { get; set; }
Property Value
HasCapacityBinding
Whether a capacity binding has actually been authored.
Declaration
public bool HasCapacityBinding { get; }
Property Value
Id
Declaration
public string Id { get; set; }
Property Value
IsTranslatingLabel
Whether the caption is translated.
Declaration
public bool IsTranslatingLabel { get; }
Property Value
Label
The optional caption drawn beside the value.
Declaration
public string Label { get; }
Property Value
MainAxisSize
How this element sizes itself along its parent box's main axis; AUTO outside a box, or when
none is authored — an element saved before this field existed deserializes it as AUTO with no
migration step required.
Declaration
public LayoutSize MainAxisSize { get; }
Property Value
MirrorForPlayer
Declaration
public bool MirrorForPlayer { get; }
Property Value
Offset
Declaration
public HudOffset Offset { get; }
Property Value
ParentId
Declaration
public string ParentId { get; }
Property Value
PartSpacing
Gap between the element's parts, when it does not follow the theme's rhythm.
Declaration
public float PartSpacing { get; }
Property Value
PlayerIndex
Declaration
public int PlayerIndex { get; }
Property Value
PreviewCapacity
Declaration
public string PreviewCapacity { get; }
Property Value
PreviewValue
Declaration
public string PreviewValue { get; }
Property Value
RefreshSignalTypeName
Declaration
public string RefreshSignalTypeName { get; }
Property Value
Representation
Declaration
public HudRepresentationKind Representation { get; }
Property Value
RepresentationSettings
The configured representation object.
Declaration
public UnityHudRepresentation RepresentationSettings { get; }
Property Value
RotationDegrees
Declaration
public float RotationDegrees { get; }
Property Value
Scale
Uniform scale for the whole element.
Declaration
public float Scale { get; }
Property Value
StartsHidden
Declaration
public bool StartsHidden { get; }
Property Value
Stretch
Per-axis stretch applied to the element's own local X and Y axes, before rotation.
Declaration
public Vector2 Stretch { get; }
Property Value
TextAlignment
How the element's text is horizontally aligned in its box.
Declaration
public UiComponentAlignmentType TextAlignment { get; }
Property Value
ThresholdRamp
The element's threshold ramp, for the view — it needs the authored colours, not only the bounds the
engine-agnostic interface exposes.
Declaration
public UnityHudThresholdRamp ThresholdRamp { get; }
Property Value
ThresholdUpperBounds
Declaration
public IReadOnlyList<double> ThresholdUpperBounds { get; }
Property Value
UpdateIntervalSeconds
Declaration
public float UpdateIntervalSeconds { get; }
Property Value
UpdateTrigger
Declaration
public HudUpdateTrigger UpdateTrigger { get; }
Property Value
UsesThemeSpacing
Whether the gap between the element's parts comes from the theme.
Declaration
public bool UsesThemeSpacing { get; }
Property Value
UsesThemeText
Whether the element writes its text the way the theme does — typeface and colour together.
Declaration
public bool UsesThemeText { get; }
Property Value
ValueBinding
Declaration
public IHudBinding ValueBinding { get; }
Property Value
ValueBindingSettings
The value binding in its concrete form, for the object reference it may carry.
Declaration
public UnityHudBinding ValueBindingSettings { get; }
Property Value
Methods
SetLabel(string, bool)
Sets the caption. Used by the builder tool.
Declaration
public void SetLabel(string caption, bool translated)
Parameters
| Type |
Name |
Description |
| string |
caption |
The caption text, or empty for none.
|
| bool |
translated |
Whether it is translated.
|
SetPlacement(UiAnchorType, Vector2, HudGrowDirection)
Sets the placement. Used by the builder tool.
Declaration
public void SetPlacement(UiAnchorType screenAnchor, Vector2 anchorOffset, HudGrowDirection direction)
Parameters
| Type |
Name |
Description |
| UiAnchorType |
screenAnchor |
The corner or edge to anchor to.
|
| Vector2 |
anchorOffset |
The nudge from that anchor.
|
| HudGrowDirection |
direction |
Which way repeating content extends.
|
SetPreviewData(string, string)
Sets the preview stand-ins. Used by the builder tool.
Declaration
public void SetPreviewData(string value, string capacity)
Parameters
| Type |
Name |
Description |
| string |
value |
Value to preview with.
|
| string |
capacity |
Maximum to preview with.
|
SetRepresentation(UnityHudRepresentation)
Sets the representation. Used by the builder tool.
Declaration
public void SetRepresentation(UnityHudRepresentation value)
Parameters
SetScale(float)
Sets the uniform scale. Used by the builder tool.
Declaration
public void SetScale(float value)
Parameters
| Type |
Name |
Description |
| float |
value |
The scale factor.
|
SetUpdatePolicy(HudUpdateTrigger, float, string)
Sets the update policy. Used by the builder tool.
Declaration
public void SetUpdatePolicy(HudUpdateTrigger trigger, float intervalSeconds, string signalTypeName)
Parameters
| Type |
Name |
Description |
| HudUpdateTrigger |
trigger |
What makes the element re-read.
|
| float |
intervalSeconds |
Seconds between reads, for the interval trigger.
|
| string |
signalTypeName |
Signal type, for the on-signal trigger.
|
Implements