summaryrefslogtreecommitdiffstats
path: root/Scripts
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2025-02-19 17:54:52 -0800
committeryum <yum.food.vr@gmail.com>2025-02-19 17:54:52 -0800
commit015d0219648efcc7d831c9c5f97e94d91a3058fa (patch)
treefd12eb4a3551ef4a95a1b8492bac5a079fa2416b /Scripts
parenta892f8feba3dc7a35f347cc61cd54a1f41a5abd6 (diff)
Bugfix: dragging and dropping new config updates text field
Diffstat (limited to 'Scripts')
-rw-r--r--Scripts/YOTSNDMFConfig.cs12
1 files changed, 9 insertions, 3 deletions
diff --git a/Scripts/YOTSNDMFConfig.cs b/Scripts/YOTSNDMFConfig.cs
index 971dd8e..a1d8bad 100644
--- a/Scripts/YOTSNDMFConfig.cs
+++ b/Scripts/YOTSNDMFConfig.cs
@@ -17,12 +17,18 @@ namespace YOTS
[TextArea(5, 80)] // Min 5 lines, max 80 lines
public string jsonContent;
+ [SerializeField, HideInInspector]
+ private TextAsset lastJsonConfig;
+
void OnValidate() {
gameObject.tag = "EditorOnly";
- // Update jsonContent when jsonConfig changes
- if (jsonConfig != null && string.IsNullOrEmpty(jsonContent)) {
- jsonContent = jsonConfig.text;
+ // Only update jsonContent when jsonConfig actually changes
+ if (jsonConfig != lastJsonConfig) {
+ if (jsonConfig != null) {
+ jsonContent = jsonConfig.text;
+ }
+ lastJsonConfig = jsonConfig;
}
}
}