WIP: Live mixing support.

checkpoint: StreamingAsset Loader.
This commit is contained in:
2026-05-18 19:25:09 +08:00
parent 3190802bd2
commit 3c2558f5e7
7 changed files with 237 additions and 22 deletions
@@ -1,4 +1,5 @@
using System;
using System.Collections;
using UnityEngine;
namespace OCES
@@ -20,9 +21,17 @@ namespace OCES
{
return this.m_assetBundle.LoadAsset<T>(path);
}
public ResourceRequest LoadAsync<T>(string path) where T : UnityEngine.Object
public void LoadAsync<T>(string path, MonoBehaviour coroutineHost, Action<T> onComplete) where T : UnityEngine.Object
{
return this.m_assetBundle.LoadAssetAsync<T>(path);
coroutineHost.StartCoroutine(LoadAsyncCoroutine(path, onComplete));
}
IEnumerator LoadAsyncCoroutine<T>(string path, Action<T> onComplete) where T : UnityEngine.Object
{
AssetBundleRequest request = this.m_assetBundle.LoadAssetAsync<T>(path);
yield return request;
onComplete?.Invoke(request.asset as T);
}
}
}