> ## Documentation Index
> Fetch the complete documentation index at: https://docs-unity.molca.id/llms.txt
> Use this file to discover all available pages before exploring further.

# Content packages (Addressables)

> Core ContentPackage system and Addressables build hooks in the shared SDK.

## 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](/core/http-client)) or general asset loading with no manifest lifecycle.

## Molca Core

**Folder:** `Packages/com.molca.core/Runtime/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:

```csharp theme={null}
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](/setup/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](/setup/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`**.

## Related

* [RuntimeManager](/core/runtime-manager) — bootstrap; resolve **`PackageSubsystem`** with **`GetSubsystem`**
* [Global Settings](/setup/global-settings) — **`ContentPackageSettings`** module
* [HttpClient](/core/http-client) — ad hoc HTTP, not the package manifest pipeline
* [Data manager](/core/data-manager) — app data layer versus Addressables packages
* [Recipe: Load and use content packages](/recipes/load-content-packages) — step-by-step guide to loading Addressable content packages at runtime

## Unity Editor

<Frame caption="Addressables / content package tooling">
  <img src="https://mintcdn.com/ptmolcateknologinusantara/jWDWJqZnZidoWqQK/images/features/core/addressables-content-packages.png?fit=max&auto=format&n=jWDWJqZnZidoWqQK&q=85&s=96f4a7ae5c94192828026c530514e6ab" alt="Addressables Content Packages" width="908" height="504" data-path="images/features/core/addressables-content-packages.png" />
</Frame>
