线条切割

This commit is contained in:
2025-05-02 14:30:04 +08:00
parent 1807699ca5
commit 4f7dece3ca
13 changed files with 306 additions and 95 deletions
@@ -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)