mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-22 10:34:30 +08:00
fix(ecs): 修复异步销毁方法返回值问题
- 移除 DestroyAsync 方法中的 async 关键字 - 修改条件判断逻辑,确保返回正确的 ValueTask.CompletedTask - 删除不必要的 await 关键字,直接返回 ValueTask.CompletedTask - 保持方法的异步操作正确性
This commit is contained in:
parent
155ca3024b
commit
db716a63cb
@ -84,9 +84,12 @@ public sealed class ArchEcsModule : IServiceModule
|
||||
/// <summary>
|
||||
/// 异步销毁
|
||||
/// </summary>
|
||||
public async ValueTask DestroyAsync()
|
||||
public ValueTask DestroyAsync()
|
||||
{
|
||||
if (!IsEnabled || !_isInitialized) return;
|
||||
if (!IsEnabled || !_isInitialized)
|
||||
{
|
||||
return ValueTask.CompletedTask;
|
||||
}
|
||||
|
||||
// 销毁所有系统
|
||||
foreach (var system in _systems)
|
||||
@ -105,7 +108,7 @@ public sealed class ArchEcsModule : IServiceModule
|
||||
|
||||
_isInitialized = false;
|
||||
|
||||
await ValueTask.CompletedTask;
|
||||
return ValueTask.CompletedTask;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user