logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class SerenityAssetLoadingModeProvider

    Single global accessor for the currently active SerenityAssetLoadingMode. Components that need to branch on the loading mode (bootstrap installer, asset utilities, audio-mixer cache, editor post-processors) read it through this provider instead of holding their own copy. The provider is intentionally a plain static class with no Unity dependencies so it can be consumed from any layer.

    The mode is normally set once during application startup (from UnitySerenityInstaller.Awake based on a serialized inspector field) and stays constant for the rest of the session.

    Slice A only adds this provider. No existing loader reads it yet, so behaviour for every existing Serenity project is unchanged until later slices wire it in.

    Inheritance
    object
    SerenityAssetLoadingModeProvider
    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.Settings
    Assembly: Serenity.UnityGlobal.Infrastructure.dll
    Syntax
    public static class SerenityAssetLoadingModeProvider

    Properties

    IsExplicitlyConfigured

    True when SetMode(SerenityAssetLoadingMode) has been called at least once in this session. Lets editor flows distinguish "user kept the default" from "user explicitly picked a mode".

    Declaration
    public static bool IsExplicitlyConfigured { get; }
    Property Value
    Type Description
    bool

    IsResourcesOnly

    True when the active mode is strictly ResourcesOnly.

    Declaration
    public static bool IsResourcesOnly { get; }
    Property Value
    Type Description
    bool

    Mode

    Currently active asset loading mode. Defaults to AddressablesWithResourcesFallback until SetMode(SerenityAssetLoadingMode) is invoked, so existing projects that never opt in keep their current behaviour.

    Declaration
    public static SerenityAssetLoadingMode Mode { get; }
    Property Value
    Type Description
    SerenityAssetLoadingMode

    UsesAddressables

    True when the active mode involves Addressables in any way.

    Declaration
    public static bool UsesAddressables { get; }
    Property Value
    Type Description
    bool

    UsesResources

    True when the active mode allows the Resources/ fallback.

    Declaration
    public static bool UsesResources { get; }
    Property Value
    Type Description
    bool

    Methods

    Reset()

    Resets the provider to its default state. For test cleanup only.

    Declaration
    public static void Reset()

    SetMode(SerenityAssetLoadingMode)

    Sets the active loading mode. Intended to be called once from the application bootstrap. Calling it again overrides the previous value; tests rely on this to switch modes between cases.

    Declaration
    public static void SetMode(SerenityAssetLoadingMode mode)
    Parameters
    Type Name Description
    SerenityAssetLoadingMode mode
    In this article
    © 2026 Serenity. All Rights Reserved