From 805ae642d486861cc23f8da00ecfc6b90c444d1f Mon Sep 17 00:00:00 2001
From: jlacoche <jeremy.lacoche@orange.com>
Date: Wed, 18 Dec 2024 15:46:36 +0100
Subject: [PATCH] fix : missing node posX and posY when editing from editor
 window

---
 Editor/Scripts/Windows/TrackableWindow.cs   | 11 ++++++++++-
 Editor/Scripts/Windows/WorldAnchorWindow.cs | 12 +++++++++++-
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/Editor/Scripts/Windows/TrackableWindow.cs b/Editor/Scripts/Windows/TrackableWindow.cs
index 4135be0..78e4223 100644
--- a/Editor/Scripts/Windows/TrackableWindow.cs
+++ b/Editor/Scripts/Windows/TrackableWindow.cs
@@ -296,7 +296,16 @@ namespace ETSI.ARF.WorldStorage.UI
                     int cnt = 0;
                     foreach (var item in obj.KeyvalueTags)
                     {
-                        if (item.Key == "unityAuthoringPosX" || item.Key == "unityAuthoringPosY") continue; // ignore internal params
+                        if (item.Key == "unityAuthoringPosX" )
+                        {
+                            nodePosX = float.Parse(item.Value[0], System.Globalization.CultureInfo.InvariantCulture);
+                            continue; // ignore internal params
+                        }
+                        else if (item.Key == "unityAuthoringPosY")
+                        {
+                            nodePosY = float.Parse(item.Value[0], System.Globalization.CultureInfo.InvariantCulture);
+                            continue;
+                        }
                         if (cnt < keyValuesFixed.Count) keyValuesFixed[cnt] = (item.Key, item.Value[0]);
                         cnt++;
                     }
diff --git a/Editor/Scripts/Windows/WorldAnchorWindow.cs b/Editor/Scripts/Windows/WorldAnchorWindow.cs
index a612081..a7bd07a 100644
--- a/Editor/Scripts/Windows/WorldAnchorWindow.cs
+++ b/Editor/Scripts/Windows/WorldAnchorWindow.cs
@@ -229,6 +229,7 @@ namespace ETSI.ARF.WorldStorage.UI
                 OutputKeyValue(0);
                 OutputKeyValue(1);
                 OutputKeyValue(2);
+                OutputKeyValue(3);
             }
             EditorGUILayout.EndToggleGroup();
             //
@@ -274,7 +275,16 @@ namespace ETSI.ARF.WorldStorage.UI
                     int cnt = 0;
                     foreach (var item in obj.KeyvalueTags)
                     {
-                        if (item.Key == "unityAuthoringPosX" || item.Key == "unityAuthoringPosY") continue; // ignore internal params
+                        if (item.Key == "unityAuthoringPosX")
+                        {
+                            nodePosX = float.Parse(item.Value[0], System.Globalization.CultureInfo.InvariantCulture);
+                            continue; // ignore internal params
+                        }
+                        else if (item.Key == "unityAuthoringPosY")
+                        {
+                            nodePosY = float.Parse(item.Value[0], System.Globalization.CultureInfo.InvariantCulture);
+                            continue;
+                        }
                         if (cnt < keyValuesFixed.Count) keyValuesFixed[cnt] = (item.Key, item.Value[0]);
                         cnt++;
                     }
-- 
GitLab