logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    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
    object
    UnityLeaderboardViewDefinition
    Implements
    ISerializationCallbackReceiver
    Namespace: Serenity.Leaderboard.Infrastructure.Settings
    Assembly: Serenity.UnityLeaderboard.Infrastructure.dll
    Syntax
    public class UnityLeaderboardViewDefinition : UnityViewDefinition, ISerializationCallbackReceiver

    Constructors

    UnityLeaderboardViewDefinition()

    Declaration
    public UnityLeaderboardViewDefinition()

    Fields

    AchievedAtDateFormat

    Declaration
    public string AchievedAtDateFormat
    Field Value
    Type Description
    string

    AroundPlayerRadius

    Declaration
    public int AroundPlayerRadius
    Field Value
    Type Description
    int

    AutoRefreshOnSubmit

    Declaration
    public bool AutoRefreshOnSubmit
    Field Value
    Type Description
    bool

    BackgroundMode

    Declaration
    public LeaderboardBackgroundMode BackgroundMode
    Field Value
    Type Description
    LeaderboardBackgroundMode

    BackgroundPixelsPerUnitMultiplier

    Declaration
    public float BackgroundPixelsPerUnitMultiplier
    Field Value
    Type Description
    float

    BackgroundSlicing

    Declaration
    public LeaderboardBackgroundSlicing BackgroundSlicing
    Field Value
    Type Description
    LeaderboardBackgroundSlicing

    BackgroundSprite

    Declaration
    public Sprite BackgroundSprite
    Field Value
    Type Description
    Sprite

    BackgroundTint

    Declaration
    public Color BackgroundTint
    Field Value
    Type Description
    Color

    BoardId

    Declaration
    public string BoardId
    Field Value
    Type Description
    string

    Buttons

    Declaration
    public List<LeaderboardViewButton> Buttons
    Field Value
    Type Description
    List<LeaderboardViewButton>

    Columns

    Declaration
    public List<LeaderboardColumnSetting> Columns
    Field Value
    Type Description
    List<LeaderboardColumnSetting>

    DecimalPlaces

    Declaration
    public int DecimalPlaces
    Field Value
    Type Description
    int

    ElementPlacements

    Declaration
    public List<LeaderboardElementPlacement> ElementPlacements
    Field Value
    Type Description
    List<LeaderboardElementPlacement>

    EmptyStateMessage

    Declaration
    public string EmptyStateMessage
    Field Value
    Type Description
    string

    EntryCount

    Declaration
    public int EntryCount
    Field Value
    Type Description
    int

    HudElements

    Declaration
    public List<UnityHudElementDefinition> HudElements
    Field Value
    Type Description
    List<UnityHudElementDefinition>

    IsTranslatingEmptyStateMessage

    Declaration
    public bool IsTranslatingEmptyStateMessage
    Field Value
    Type Description
    bool

    IsTranslatingTitle

    Declaration
    public bool IsTranslatingTitle
    Field Value
    Type Description
    bool

    Mode

    Declaration
    public LeaderboardViewMode Mode
    Field Value
    Type Description
    LeaderboardViewMode

    RankingMode

    Declaration
    public LeaderboardRankingMode RankingMode
    Field Value
    Type Description
    LeaderboardRankingMode

    ReturnViewId

    Declaration
    public string ReturnViewId
    Field Value
    Type Description
    string

    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
    Type Description
    bool

    ShowColumnHeaders

    Declaration
    public bool ShowColumnHeaders
    Field Value
    Type Description
    bool

    Title

    Declaration
    public string Title
    Field Value
    Type Description
    string

    ValueFormat

    Declaration
    public LeaderboardValueFormat ValueFormat
    Field Value
    Type Description
    LeaderboardValueFormat

    Methods

    HasAuthoredPlacement(LeaderboardViewElement)

    Whether the author has actually repositioned element — a raw entry exists, as opposed to the shared default ResolvePlacement(LeaderboardViewElement) falls back to.

    Declaration
    public bool HasAuthoredPlacement(LeaderboardViewElement element)
    Parameters
    Type Name Description
    LeaderboardViewElement element
    Returns
    Type Description
    bool

    ResolveBackgroundStyle()

    Resolves this view's authored background fields into the single style ConfigureBackground(LeaderboardBackgroundStyle) applies. Mirrors ResolveColumnLayout(): callers read the resolved shape, never the raw settings fields.

    Declaration
    public LeaderboardBackgroundStyle ResolveBackgroundStyle()
    Returns
    Type Description
    LeaderboardBackgroundStyle

    ResolveButtons()

    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
    Type Description
    IReadOnlyList<LeaderboardViewButton>

    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
    Type Description
    LeaderboardColumnLayout

    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
    Type Description
    IReadOnlyList<LeaderboardElementPlacement>

    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
    Type Description
    IReadOnlyList<UnityHudElementDefinition>

    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
    Type Name Description
    LeaderboardViewElement element
    Returns
    Type Description
    LeaderboardElementPlacement

    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
    Type Description
    ValueDisplaySpec

    Implements

    UnityEngine.ISerializationCallbackReceiver
    In this article
    © 2026 Serenity. All Rights Reserved