logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class UnitySingletonSettingsLoader

    Loads the single settings asset an installer needs for a module label, applying the project-ownership rule: a project-owned settings asset beats a shipped one with the same Id (SingletonSettingsSelection). Replaces the historical candidates.Length > 0 ? candidates[0] : null idiom, which picked whichever asset Addressables/Resources happened to enumerate first.

    In SerenityAssetLoadingMode.ResourcesOnly, LoadAllFromAnyBlocking<T>(string) ignores labels entirely (Resources.LoadAll has no label concept) and returns every asset of type T under a Resources/ folder. Since Serenity never ships its own settings under Assets/Serenity/Resources (see the "AutoLoad" warning on LoadAllFromAnyBlocking<T>(string)), every candidate found this way is project content by construction, so the module-label query and the PROJECT_OWNED query return the same set and ownership resolves correctly with no special-casing.

    Inheritance
    object
    UnitySingletonSettingsLoader
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.Global.Infrastructure.Utils
    Assembly: Serenity.UnityGlobal.Infrastructure.dll
    Syntax
    public static class UnitySingletonSettingsLoader

    Methods

    LoadBlocking<T>(IEnumerable<string>, ILogService)

    Loads every candidate settings asset of type T for moduleLabels, then picks the project-owned one when present, falling back to a shipped one otherwise. Returns null when no candidate exists at all — the caller keeps its own "not found" warning or exception, unchanged.

    Declaration
    public static T LoadBlocking<T>(IEnumerable<string> moduleLabels, ILogService logService) where T : Object, IFoundationSettings
    Parameters
    Type Name Description
    IEnumerable<string> moduleLabels
    ILogService logService
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T

    LoadBlocking<T>(string, ILogService)

    Loads the single settings asset for one module label. See the multi-label overload.

    Declaration
    public static T LoadBlocking<T>(string moduleLabel, ILogService logService) where T : Object, IFoundationSettings
    Parameters
    Type Name Description
    string moduleLabel
    ILogService logService
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T
    In this article
    © 2026 Serenity. All Rights Reserved