线条切割
This commit is contained in:
@@ -60,20 +60,11 @@ namespace AibisDream.Framework
|
||||
|
||||
public static T LoadAssetSync<T>(string key) where T : UnityEngine.Object
|
||||
{
|
||||
T result = null;
|
||||
var operation = Addressables.LoadAssetAsync<T>(key);
|
||||
|
||||
// 运行协程等待加载完成
|
||||
GameManager.Instance.StartCoroutine(LoadCoroutine(operation, loadedObject => result = loadedObject));
|
||||
operation.WaitForCompletion();
|
||||
|
||||
// 等待协程完成(阻塞主线程)
|
||||
while (!operation.IsDone)
|
||||
{
|
||||
// 主动让出一帧
|
||||
System.Threading.Thread.Sleep(1);
|
||||
}
|
||||
|
||||
return result;
|
||||
return operation.Result;
|
||||
}
|
||||
|
||||
private static IEnumerator LoadCoroutine<T>(AsyncOperationHandle<T> operation, Action<T> onComplete)
|
||||
|
||||
Reference in New Issue
Block a user