diff --git a/DungeonShooting_Godot/src/framework/common/Utils.cs b/DungeonShooting_Godot/src/framework/common/Utils.cs index 0bdcbd4..db71ecd 100644 --- a/DungeonShooting_Godot/src/framework/common/Utils.cs +++ b/DungeonShooting_Godot/src/framework/common/Utils.cs @@ -10,9 +10,12 @@ /// /// 默认随机数对象 /// - public static SeedRandom Random { get; } + public static SeedRandom Random { get; private set; } - static Utils() + /// + /// 初始化随机种子 + /// + public static void InitRandom() { Random = new SeedRandom(); Debug.Log("随机种子为: ", Random.Seed); diff --git a/DungeonShooting_Godot/src/game/GameApplication.cs b/DungeonShooting_Godot/src/game/GameApplication.cs index 276b27d..66ef8b7 100644 --- a/DungeonShooting_Godot/src/game/GameApplication.cs +++ b/DungeonShooting_Godot/src/game/GameApplication.cs @@ -84,6 +84,8 @@ { Instance = this; TargetFps = (int)DisplayServer.ScreenGetRefreshRate(); + + Utils.InitRandom(); //初始化配置表 ExcelConfig.Init();