Class UnityLeaderboardViewDefinition
A view definition that renders a leaderboard board through a UnityLeaderboardPanel. It is a
first-class transition target: a menu option (or a ShowLeaderboardSignal) with this view's Id
shows it through the IViewRouter, exactly like a
cascade or composite view.
Inheritance
UnityLeaderboardViewDefinition
Implements
ISerializationCallbackReceiver
Assembly: Serenity.UnityLeaderboard.Infrastructure.dll
Syntax
public class UnityLeaderboardViewDefinition : UnityViewDefinition, ISerializationCallbackReceiver
Constructors
UnityLeaderboardViewDefinition()
Declaration
public UnityLeaderboardViewDefinition()
Fields
Declaration
public string AchievedAtDateFormat
Field Value
AroundPlayerRadius
Declaration
public int AroundPlayerRadius
Field Value
AutoRefreshOnSubmit
Declaration
public bool AutoRefreshOnSubmit
Field Value
BackgroundMode
Declaration
public LeaderboardBackgroundMode BackgroundMode
Field Value
BackgroundPixelsPerUnitMultiplier
Declaration
public float BackgroundPixelsPerUnitMultiplier
Field Value
BackgroundSlicing
Declaration
public LeaderboardBackgroundSlicing BackgroundSlicing
Field Value
BackgroundSprite
Declaration
public Sprite BackgroundSprite
Field Value
BackgroundTint
Declaration
public Color BackgroundTint
Field Value
BoardId
Declaration
Field Value
Declaration
public List<LeaderboardViewButton> Buttons
Field Value
Columns
Declaration
public List<LeaderboardColumnSetting> Columns
Field Value
DecimalPlaces
Declaration
Field Value
ElementPlacements
Declaration
public List<LeaderboardElementPlacement> ElementPlacements
Field Value
EmptyStateMessage
Declaration
public string EmptyStateMessage
Field Value
EntryCount
Declaration
Field Value
HudElements
Declaration
public List<UnityHudElementDefinition> HudElements
Field Value
IsTranslatingEmptyStateMessage
Declaration
public bool IsTranslatingEmptyStateMessage
Field Value
IsTranslatingTitle
Declaration
public bool IsTranslatingTitle
Field Value
Mode
Declaration
public LeaderboardViewMode Mode
Field Value
RankingMode
Declaration
public LeaderboardRankingMode RankingMode
Field Value
ReturnViewId
Declaration
public string ReturnViewId
Field Value
ShowBackground
Legacy field, kept only as the lazy migration's source: off hid the panel's background, on showed it
(the theme's, or BackgroundSprite when authored). Superseded by BackgroundMode;
see UnityEngine.ISerializationCallbackReceiver.OnAfterDeserialize. The initializer MUST stay
true: Unity only overlays fields present in the serialized YAML, so a brand-new instance keeps
this initializer (and, with Serenity.Leaderboard.Infrastructure.Settings.UnityLeaderboardViewDefinition._backgroundModeMigrated starting false, migrates itself
to THEME) while an old asset's explicit ShowBackground
value always overlays it.
Declaration
public bool ShowBackground
Field Value
ShowColumnHeaders
Declaration
public bool ShowColumnHeaders
Field Value
Title
Declaration
Field Value
Declaration
public LeaderboardValueFormat ValueFormat
Field Value
Methods
HasAuthoredPlacement(LeaderboardViewElement)
Declaration
public bool HasAuthoredPlacement(LeaderboardViewElement element)
Parameters
Returns
ResolveBackgroundStyle()
Declaration
public LeaderboardBackgroundStyle ResolveBackgroundStyle()
Returns
This view's authored buttons, in author order, with any null entry dropped (a recipe import or a
designer edit mid-flight can leave one). Never null.
Declaration
public IReadOnlyList<LeaderboardViewButton> ResolveButtons()
Returns
ResolveColumnLayout()
Resolves this view's authored columns into the single layout that determines how rows split into
cells. Mirrors ResolveValueSpec(): callers read the resolved shape, never the raw
settings fields.
Declaration
public LeaderboardColumnLayout ResolveColumnLayout()
Returns
ResolveElementPlacements()
The resolved placement for every LeaderboardViewElement, in enum order, with defaults
filled in for any element that has no authored entry. BACKGROUND
is the one exception: a themed background is authored full-stretch in its prefab, a shape this
anchor-plus-size placement model cannot express, so an unauthored background is omitted entirely
rather than collapsed onto the default's centered point.
Declaration
public IReadOnlyList<LeaderboardElementPlacement> ResolveElementPlacements()
Returns
ResolveHudElements()
This view's authored HUD elements, in author order, with any null entry dropped (a recipe import or a
designer edit mid-flight can leave one). Never null.
Declaration
public IReadOnlyList<UnityHudElementDefinition> ResolveHudElements()
Returns
ResolvePlacement(LeaderboardViewElement)
The placement to use for element: the first authored entry for it, returned by
reference, or a clone of the shared default when none is authored — the caller is always free to
mutate a fallback without corrupting LeaderboardElementPlacementDefaults for every other
definition in the project.
Declaration
public LeaderboardElementPlacement ResolvePlacement(LeaderboardViewElement element)
Parameters
Returns
ResolveValueSpec()
Resolves this view's format and precision into the single spec that renders a value, so callers never
carry the two as a pair that can drift apart. Precision is clamped by the spec.
Declaration
public ValueDisplaySpec ResolveValueSpec()
Returns
Implements
UnityEngine.ISerializationCallbackReceiver