diff --git a/GFramework.Game/Setting/SettingsSystem.cs b/GFramework.Game/Setting/SettingsSystem.cs index 6b5b2aed..b73580a7 100644 --- a/GFramework.Game/Setting/SettingsSystem.cs +++ b/GFramework.Game/Setting/SettingsSystem.cs @@ -19,7 +19,7 @@ public class SettingsSystem : AbstractSystem, ISettingsSystem public async Task ApplyAll() { // 遍历所有设置应用器并尝试应用 - foreach (var applicator in _model.AllApplicators()) await TryApplyAsync(applicator); + foreach (var applicator in _model.AllApplicators()) await TryApplyAsync(applicator).ConfigureAwait(false); } /// @@ -41,7 +41,7 @@ public class SettingsSystem : AbstractSystem, ISettingsSystem /// 完成的任务 public async Task SaveAll() { - await _model.SaveAllAsync(); + await _model.SaveAllAsync().ConfigureAwait(false); } /// @@ -51,7 +51,7 @@ public class SettingsSystem : AbstractSystem, ISettingsSystem public async Task ResetAll() { _model.ResetAll(); - await ApplyAll(); + await ApplyAll().ConfigureAwait(false); } /// @@ -62,7 +62,7 @@ public class SettingsSystem : AbstractSystem, ISettingsSystem public async Task Reset() where T : class, ISettingsData, IResetApplyAbleSettings, new() { _model.Reset(); - await Apply(); + await Apply().ConfigureAwait(false); } @@ -87,7 +87,7 @@ public class SettingsSystem : AbstractSystem, ISettingsSystem try { - await applyAbleSettings.ApplyAsync(); + await applyAbleSettings.ApplyAsync().ConfigureAwait(false); // 发送设置应用成功事件 this.SendEvent(new SettingsAppliedEvent(section, true)); } diff --git a/GFramework.Game/Storage/ScopedStorage.cs b/GFramework.Game/Storage/ScopedStorage.cs index b0714783..7ab8c856 100644 --- a/GFramework.Game/Storage/ScopedStorage.cs +++ b/GFramework.Game/Storage/ScopedStorage.cs @@ -102,7 +102,7 @@ public sealed class ScopedStorage(IStorage inner, string prefix) : IScopedStorag /// 异步操作任务 public async Task DeleteAsync(string key) { - await inner.DeleteAsync(Key(key)); + await inner.DeleteAsync(Key(key)).ConfigureAwait(false); } /// @@ -166,4 +166,4 @@ public sealed class ScopedStorage(IStorage inner, string prefix) : IScopedStorag { return new ScopedStorage(inner, Key(scope)); } -} \ No newline at end of file +}