Skip to main content

When to use

Use the content package stack when you need downloadable or remotely updated content (scenarios, bundles, or other Addressables-driven payloads) that should integrate with Molca’s runtime package service and editor tooling. Reach for PackageSubsystem / IPackageService after RuntimeManager has finished initializing—not for one-off HTTP downloads (see HttpClient) or general asset loading with no manifest lifecycle.

Molca Core

Folder: Assets/_Molca/_Core/ContentPackage/ — download queue, manifest cache, package state, and related services. Use when shipping downloadable scenario or asset bundles.

Editor notification

Assets/_MolcaSDK/Code/Scripts/Editor/AddressablesBuildNotificationProvider.cs — ties Addressables builds into Molca editor notifications (verify behavior in your Unity version).

Code

Runtime work goes through PackageSubsystem on the RuntimeManager prefab:
using Molca;
using Molca.ContentPackage.Services;
using UnityEngine;

public class ContentBootstrap : MonoBehaviour
{
    private async void Start()
    {
        await RuntimeManager.WaitForInitialization();
        var ps = RuntimeManager.GetSubsystem<PackageSubsystem>();
        if (ps?.PackageService == null)
        {
            Debug.LogWarning("PackageSubsystem or PackageService not available.");
            return;
        }
        // Use ps.PackageService per IPackageService in ContentPackage folder
    }
}
Inspect ContentPackageSettings via Global Settings (module on the GlobalSettings asset).

Troubleshooting

  • PackageSubsystem or PackageService is null — Ensure the RuntimeManager prefab includes PackageSubsystem, the scene has completed RuntimeManager.WaitForInitialization(), and you are querying the subsystem from play mode (or after async init), not from a [RuntimeInitializeOnLoadMethod] that runs before the prefab exists.
  • Downloads never start or queue looks stuck — Confirm ContentPackageSettings on Global Settings, Addressables labels/paths, and platform build output match what the service expects; check the Unity console and any package-specific logs in the ContentPackage implementation.
  • Wrong or missing bundle after an Addressables build — Run a clean Addressables build, verify remote catalog URLs and profile settings, and confirm AddressablesBuildNotificationProvider behavior for your Unity/Addressables version (see Editor notification above).
  • Content loads in Editor but not in player — Compare Addressables Play Mode Script vs standalone build configuration, CCD/remote hosting, and that initialization order still awaits WaitForInitialization() before using PackageService.

Unity Editor

Addressables Content Packages