diff --git a/DungeonShooting_Godot/addons/dungeonShooting_plugin/Plugin.cs b/DungeonShooting_Godot/addons/dungeonShooting_plugin/Plugin.cs index e45e20d..27c2b46 100644 --- a/DungeonShooting_Godot/addons/dungeonShooting_plugin/Plugin.cs +++ b/DungeonShooting_Godot/addons/dungeonShooting_plugin/Plugin.cs @@ -78,16 +78,16 @@ { Instance = this; - //GD.Print("_uiMonitor == null: " + (_uiMonitor == null)); if (_uiMonitor != null) { _uiMonitor.Process((float) delta); } - // else - // { - // _uiMonitor = new NodeMonitor(); - // OnSceneChanged(GetEditorInterface().GetEditedSceneRoot()); - // } + else + { + _uiMonitor = new NodeMonitor(); + _uiMonitor.SceneNodeChangeEvent += GenerateUiCode; + OnSceneChanged(GetEditorInterface().GetEditedSceneRoot()); + } } public override void _EnterTree() @@ -142,6 +142,7 @@ _uiMonitor = new NodeMonitor(); _uiMonitor.SceneNodeChangeEvent += GenerateUiCode; + OnSceneChanged(GetEditorInterface().GetEditedSceneRoot()); } public override void _ExitTree() diff --git a/DungeonShooting_Godot/src/game/GameApplication.cs b/DungeonShooting_Godot/src/game/GameApplication.cs index 39f0116..34e1d0e 100644 --- a/DungeonShooting_Godot/src/game/GameApplication.cs +++ b/DungeonShooting_Godot/src/game/GameApplication.cs @@ -81,7 +81,7 @@ //打开ui UiManager.Open_RoomUI(); - + RoomManager = ResourceManager.Load(ResourcePath.scene_Room_tscn).Instantiate(); SceneRoot.AddChild(RoomManager); } diff --git a/DungeonShooting_Godot/src/game/manager/ResourcePath.cs b/DungeonShooting_Godot/src/game/manager/ResourcePath.cs index e048569..ba1e64c 100644 --- a/DungeonShooting_Godot/src/game/manager/ResourcePath.cs +++ b/DungeonShooting_Godot/src/game/manager/ResourcePath.cs @@ -18,7 +18,6 @@ public const string prefab_test_TestActivity_tscn = "res://prefab/test/TestActivity.tscn"; public const string prefab_ui_EditorTools_tscn = "res://prefab/ui/EditorTools.tscn"; public const string prefab_ui_RoomUI_tscn = "res://prefab/ui/RoomUI.tscn"; - public const string prefab_ui_TestUi_tscn = "res://prefab/ui/TestUi.tscn"; public const string prefab_weapon_Knife_tscn = "res://prefab/weapon/Knife.tscn"; public const string prefab_weapon_Weapon_tscn = "res://prefab/weapon/Weapon.tscn"; public const string prefab_weapon_bullet_Bullet_tscn = "res://prefab/weapon/bullet/Bullet.tscn";