logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class UnityLeaderboardScoreSubmitter

    Gameplay MonoBehaviour that submits the local player's current score to a leaderboard board, with zero hand-written glue.

    Inheritance
    object
    UnityLeaderboardScoreSubmitter
    Namespace: Serenity.Leaderboard.Infrastructure.Components
    Assembly: Serenity.UnityLeaderboard.Infrastructure.dll
    Syntax
    public class UnityLeaderboardScoreSubmitter : MonoBehaviour
    Remarks

    Delegates to UnityLeaderboardScoreBridge, which is otherwise a plain C# class the game has to construct and wire by hand (see the Leaderboard cookbook's "hand-wired bridge" note). This component is the shipped, no-code owner of that wiring: drop it on a scene object, set Serenity.Leaderboard.Infrastructure.Components.UnityLeaderboardScoreSubmitter.boardId, and call SubmitNow() from any trigger — a SignalReactionComponent, a UnityEvent, or your own code. Deliberately carries no signal subscription of its own: the framework has no run-end signal to listen for (GameMode has no GameOver; EndGameSessionSignal means "return to menu"), so wiring the trigger is left to the game, exactly like every other UnityEvent-bindable entry point in Serenity. Never throws: an unconfigured board id, unresolved dependencies or an unresolvable player identity all log a warning (latched, so a permanently missing dependency does not spam the log) and return without submitting — matching the framework's never-throw-in-runtime philosophy and UnityLeaderboardScoreBridge's own never-throw contract.

    Constructors

    UnityLeaderboardScoreSubmitter()

    Declaration
    public UnityLeaderboardScoreSubmitter()

    Methods

    SubmitNow()

    Saves the current score snapshot, then submits it to the configured board for the local player. Must return void, not Task, so it appears as a callable target in the Inspector's UnityEvent dropdown — a non-void method appears there too but throws at invocation time (see SignalEmitterComponent.DispatchSignal's documented UnityEvent contract). Deliberately unguarded against overlapping calls: two rapid triggers submit twice, which best-per-player retention resolves to the same best entry either way.

    Declaration
    public void SubmitNow()
    In this article
    © 2026 Serenity. All Rights Reserved