logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class UnityScoreRepository

    Unity implementation of IScoreRepository using PlayerPrefs for persistence.

    Inheritance
    object
    UnityScoreRepository
    Implements
    IScoreRepository
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.Score.Infrastructure.Repositories
    Assembly: Serenity.UnityScore.Infrastructure.dll
    Syntax
    public class UnityScoreRepository : IScoreRepository
    Remarks

    Stores score records as JSON strings in PlayerPrefs, keyed by metric name. Suitable for lightweight, local-only score storage.

    Constructors

    UnityScoreRepository()

    Declaration
    public UnityScoreRepository()

    Methods

    Clear()

    Declaration
    public void Clear()

    LoadAll()

    Declaration
    public ScoreRecord[] LoadAll()
    Returns
    Type Description
    ScoreRecord[]

    Save(ScoreSnapshot)

    Declaration
    public void Save(ScoreSnapshot snapshot)
    Parameters
    Type Name Description
    ScoreSnapshot snapshot

    TryLoadLatest(out ScoreRecord)

    Declaration
    public bool TryLoadLatest(out ScoreRecord record)
    Parameters
    Type Name Description
    ScoreRecord record
    Returns
    Type Description
    bool

    Implements

    IScoreRepository
    In this article
    © 2026 Serenity. All Rights Reserved