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
|
||||
@@ -9,9 +10,17 @@ namespace OCES
|
||||
{
|
||||
return Resources.Load<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 Resources.LoadAsync<T>(path);
|
||||
coroutineHost.StartCoroutine(LoadAsyncCoroutine(path, onComplete));
|
||||
}
|
||||
|
||||
IEnumerator LoadAsyncCoroutine<T>(string path, Action<T> onComplete) where T : UnityEngine.Object
|
||||
{
|
||||
ResourceRequest request = Resources.LoadAsync<T>(path);
|
||||
yield return request;
|
||||
onComplete?.Invoke(request.asset as T);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user