Skip to content

Commit 8d6689b

Browse files
committed
[修改]1. 修改全局配置的重复设置的警告打印
1 parent 76c5325 commit 8d6689b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

GameFrameX.Utility/Setting/GlobalSettings.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using GameFrameX.Foundation.Json;
2+
using GameFrameX.Foundation.Logger;
23
using GameFrameX.Utility.Extensions;
34

45
namespace GameFrameX.Utility.Setting;
@@ -77,13 +78,13 @@ public static void Load(string path)
7778
/// 2. 不允许传入null值
7879
/// 3. 会自动校正SaveDataInterval的值,如果小于5000毫秒则使用默认值
7980
/// </remarks>
80-
/// <exception cref="InvalidOperationException">当CurrentSetting已存在时抛出此异常</exception>
8181
/// <exception cref="ArgumentNullException">当传入的setting参数为null时抛出此异常</exception>
8282
public static void SetCurrentSetting(AppSetting setting)
8383
{
8484
if (CurrentSetting.IsNotNull())
8585
{
86-
throw new InvalidOperationException("当前设置已经存在,不能再次设置");
86+
LogHelper.WarnConsole("当前设置已经存在,不能再次设置");
87+
return;
8788
}
8889

8990
ArgumentNullException.ThrowIfNull(setting, nameof(setting));

0 commit comments

Comments
 (0)