WIP: Live mixing support.
checkpoint: StreamingAsset Loader.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user