logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Enum SerenityAssetLoadingMode

    Selects how Serenity discovers and loads runtime assets such as module definitions, audio clips and prefabs. The mode is global to the running application and is consumed by the asset utilities, the audio-mixer cache, the bootstrap installer, and any future Serenity loader that may differ between Addressables and Resources backends.

    This Slice A introduces the enum as foundation only. No runtime loader behaviour changes in this slice; subsequent slices wire the mode into UnityAssetUtils, AudioMixerDependencyCache, and the editor exporter.

    Underlying values are pinned. AddressablesWithResourcesFallback is explicitly 0 so that any existing scene/prefab whose UnitySerenityInstaller was serialized before this field existed deserializes the missing field as Unity's default integer 0 — i.e. as the safe legacy behaviour. The C# field initializer on UnitySerenityInstaller.AssetLoadingMode also picks AddressablesWithResourcesFallback, but the explicit underlying value is what protects already-saved assets.

    The default in Serenity.Global.Infrastructure.Settings.SerenityAssetLoadingModeProvider is also AddressablesWithResourcesFallback so existing projects that do not opt in keep the exact behaviour they had before the mode existed.

    Stability contract. Once shipped, these integer values must not be changed: any already-serialized asset relies on them. New modes must use the next unused integer, never renumber existing ones.

    Namespace: Serenity.Global.Domain.Enums
    Assembly: Serenity.Global.Domain.dll
    Syntax
    public enum SerenityAssetLoadingMode

    Fields

    Name Description
    AddressablesOnly

    Assets are loaded exclusively through Unity Addressables. No Resources/ fallback is attempted. Choose this for production builds whose content pipeline is fully Addressables-based.

    AddressablesWithResourcesFallback

    Assets are loaded through Unity Addressables first, then a Resources/ fallback is attempted for missing entries. This matches the behaviour of Serenity before the loading-mode concept existed and is therefore the default.

    Pinned to underlying value 0 so existing scenes/prefabs deserialize safely.

    ResourcesOnly

    Assets are loaded exclusively from Resources/ folders. The Addressables package is never queried at runtime. Choose this for projects that do not ship an Addressables catalog (for example, a WebGL build packaged without an Addressables content build).

    In this article
    © 2026 Serenity. All Rights Reserved