From 359b193ddf4b8e0a44b17f6351a7f34d2397e86b Mon Sep 17 00:00:00 2001 From: Rendo Date: Thu, 17 Jul 2025 21:13:56 +0500 Subject: [PATCH] hot reload only on edited property --- addons/pvzadventure/scripts/AdventureEditor.cs | 3 +-- resources/levels/balance_and_spawn_test.tres | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/addons/pvzadventure/scripts/AdventureEditor.cs b/addons/pvzadventure/scripts/AdventureEditor.cs index 8f3aebc..c0cbbf9 100644 --- a/addons/pvzadventure/scripts/AdventureEditor.cs +++ b/addons/pvzadventure/scripts/AdventureEditor.cs @@ -40,9 +40,8 @@ public partial class AdventureEditor : MarginContainer } public void OnInspectorPropertyChanged(string property) { - if (EditorInterface.Singleton.GetInspector().GetEditedObject() is AdventureLevelResource resource) + if (EditorInterface.Singleton.GetInspector().GetEditedObject() is AdventureLevelResource resource && resource.ResourcePath == editedPath) { - editedPath = resource.ResourcePath; HardReload(); } } diff --git a/resources/levels/balance_and_spawn_test.tres b/resources/levels/balance_and_spawn_test.tres index 1ae978b..5d379a1 100644 --- a/resources/levels/balance_and_spawn_test.tres +++ b/resources/levels/balance_and_spawn_test.tres @@ -9,14 +9,14 @@ script = ExtResource("3_cugtx") zombiesOrdered = Array[ExtResource("4_y1e37")]([]) events = Array[ExtResource("2_otfbt")]([]) -customWaveDelay = -1.0 +customWaveDelay = 0.0 isHugeWave = false [resource] script = ExtResource("1_46lr8") startSun = 50.0 wavePercentage = 0.0 -standardWaveDelay = 0.0 -initialWaveDelay = 0.0 +standardWaveDelay = 30.0 +initialWaveDelay = 1.0 waves = [SubResource("Resource_qsvr4")] initialScenes = Array[PackedScene]([null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null])