logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class AchievementBackendFactory

    Resolves the IAchievementStore backend selected by the shared, consumer-agnostic UnityStructuredBackendDefinition asset assigned to UnityAchievementSettings.Backend, dispatching on the asset's concrete type — checking ICustomStructuredBackendDefinition FIRST so a project-defined store wins — then wraps the resolved IStructuredStore once in a StructuredStoreAchievementAdapter. Store construction lives in the shared StructuredBackendStores helper, parameterized by this factory's StructuredBackendConsumerProfile.

    Inheritance
    object
    AchievementBackendFactory
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.Achievements.Installation.Installers
    Assembly: Serenity.UnityAchievements.Installation.dll
    Syntax
    public static class AchievementBackendFactory
    Remarks

    A null backend — and every misconfigured, driver-gated, or failed one — falls back to the device's PlayerPrefs key-value store (the achievements' zero-config default) with a warning. This factory never throws, matching the framework's never-throw-in-runtime philosophy.

    Methods

    Create(UnityStructuredBackendDefinition, StoreTable, StoreTable, ILogService)

    Resolves and constructs the configured achievement store, dispatching on the backend asset's concrete type.

    Declaration
    public static IAchievementStore Create(UnityStructuredBackendDefinition backendDefinition, StoreTable unlocksTable, StoreTable progressTable, ILogService logService)
    Parameters
    Type Name Description
    UnityStructuredBackendDefinition backendDefinition

    The backend selection, or null to use the PlayerPrefs key-value store.

    StoreTable unlocksTable

    The table or collection unlock records persist through.

    StoreTable progressTable

    The table or collection progress rows persist through.

    ILogService logService

    Logging service used to report an unavailable backend or configuration fallback. May be null.

    Returns
    Type Description
    IAchievementStore

    The resolved IAchievementStore.

    ResolveTables(string, string, ILogService)

    Resolves the two achievement tables from the settings-configured names, or the defaults when blank.

    Declaration
    public static (StoreTable Unlocks, StoreTable Progress) ResolveTables(string unlocksTableName, string progressTableName, ILogService logService = null)
    Parameters
    Type Name Description
    string unlocksTableName

    The configured unlocks table or collection name, or null/blank for the default.

    string progressTableName

    The configured progress table or collection name, or null/blank for the default.

    ILogService logService

    Logging service used to report a rejected name. May be null.

    Returns
    Type Description
    (StoreTable Unlocks, StoreTable Progress)

    The unlocks and progress tables, in that order.

    Remarks

    A name the store rejects (spaces, punctuation, an injection attempt) falls back to the default rather than propagating: this runs inside the install pass, and a typo in one inspector field must not take the whole boot down with it.

    In this article
    © 2026 Serenity. All Rights Reserved