Skip to content

Assets

Use RedEngine.Assets when a prefab, scene, or content pack must be loaded without a direct inspector reference. Keep the returned operation or reference alive while the content is in use, then release the ownership explicitly.

Execution model

  • Authority — State Authority decides gameplay spawns and synchronized scene changes.
  • Prediction — loading and mounting assets is not gameplay prediction.
  • Replicated — stable asset identity and network state referring to loaded definitions.
  • Local only — downloads, caches, progress UI, thumbnails, particles, audio, and presentation instances.

ContentManager

ContentManager is the startup and ownership boundary for project content. It supports Unity Addressables, classic Unity AssetBundle files delivered through a platform manifest, and scenes from the active Build Profile or Addressables.

RedEngine does not introduce a custom bundle format. Remote bundles remain ordinary Unity AssetBundles; Unity's Addressables ResourceManager performs dependency, hash, download, mount, and release work through AsyncOperationHandle values.

Bootstrap initializes content from EngineSettings. Tools and isolated runtimes can also initialize it directly:

csharp
bool ready = await ContentManager.InitializeAsync(
    ContentInitializationOptions.Default,
    cancellationToken);

if (!ready)
    return;
APIUse
InitializeAsync(options, token)Await the complete initialization pipeline
InitializeOperation(options)Work with the underlying AsyncOperationHandle<bool>
State / OnStateChangedPresent individual initialization stages
Shutdown()Release initialization, bundles, network assets, and scene tracking

Initialization can initialize Addressables, update catalogs, load the remote platform manifest, preload selected bundles, resolve scenes, and preload the network asset table.

AssetReference API

A typed reference delegates loading to its serialized provider:

csharp
[SerializeField] private AssetReference<GameObject> enemyReference = new();

AsyncOperationHandle<GameObject> handle = enemyReference.LoadAssetAsync();
handle.Completed += completed =>
{
    if (completed.Status == AsyncOperationStatus.Succeeded)
        SpawnVisual(completed.Result);
};

// Release when this owner no longer uses the asset.
enemyReference.ReleaseAsset();

The built-in providers cover static inspector objects, Resources, and Addressables. All return the same AsyncOperationHandle<T> surface, so gameplay code does not branch by source. A reference owns at most one active operation: release it before starting another load through the same reference.

AssetBundle API

Set remoteContentUrl to the directory that contains the platform manifest and bundle files. RedEngine uses android, ios, windows, macos, and webgl platform folders.

csharp
var bundle = new AssetBundleReference("arena");

AsyncOperationHandle<AssetBundleManifest> manifest =
    ContentManager.UpdateManifestAsync();

await manifest.Task;
if (manifest.Status != AsyncOperationStatus.Succeeded)
    return;

AsyncOperationHandle<AssetBundle> mount = bundle.MountAsync(
    AssetBundleMountOptions.CheckCRC |
    AssetBundleMountOptions.PreloadAssets);

await mount.Task;
if (mount.Status == AsyncOperationStatus.Succeeded)
    UseMountedBundle(mount.Result);

bundle.Release();

Supported bundle operations:

  • ContentManager.UpdateManifestAsync() downloads the current platform manifest;
  • ContentManager.MountAsync(reference, options) mounts a bundle and its dependencies;
  • AssetBundleReference.MountAsync(options) retains the handle on the reference;
  • PreloadAssetsAsync and LoadAllAssetsAsync load objects from a mounted bundle;
  • IsMounted(reference) checks the central mount table;
  • AssetBundleReference.Release() releases ownership held by that reference;
  • ContentManager.Shutdown() releases central bundle ownership.

Add frequently used bundles to ContentInitializationOptions.preloadBundles. PreloadAssets makes mounting slower but first access predictable; CheckCRC enables Unity integrity validation.

Placeholder: ContentManager AssetBundle pipeline

Scene references

SceneReference can resolve a Build Profile scene or an Addressable scene labeled Scene:

csharp
Scene arena = await arenaScene.LoadAsync(
    LoadSceneMode.Additive,
    cancellationToken);

if (arena.IsValid())
    await arenaScene.UnloadAsync(cancellationToken);

This API is useful outside an active network world. During a running Fusion match, use World.LoadSceneAsync and World.UnloadSceneAsync so the runner coordinates the additional level. See GameInstance and Travel.

Next: Network ScriptableObjects.

Updated:

RedEngine Framework documentation