Commit 3857ad31 authored by Sylvain Renault's avatar Sylvain Renault
Browse files

New baseWindow class for the UI editor windows.

Messagebox is shown before deleting an object from its window.
Some enhanced UI updates.
parent 9dbc0e0c
Loading
Loading
Loading
Loading
+117 −0
Original line number Diff line number Diff line
//
// ARF - Augmented Reality Framework (ETSI ISG ARF)
//
// Copyright 2024 ETSI
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Last change: June 2024
//

#define isDEBUG

using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;

using UnityEngine;
using UnityEditor;
using TMPro;

using ETSI.ARF.WorldStorage.REST;
using ETSI.ARF.OpenAPI.WorldStorage;

namespace ETSI.ARF.WorldStorage.UI
{
    public abstract class BaseWindow<T> : EditorWindow
    {
        [HideInInspector] public WorldStorageServer worldStorageServer;
        [HideInInspector] public WorldStorageUser worldStorageUser;

        [SerializeField] public List<string> trackables = new List<string>();

        //
        // Keyvalues
        //
        [SerializeField] protected KeyvalueTagList keyValueTags = new KeyvalueTagList();
        protected List<(string, string)> keyValuesFixed = new List<(string, string)>(3)
        {
            ("", ""),("", ""),("", "")
        };
        protected void OutputKeyValue(int n)
        {
            string i1 = keyValuesFixed[n].Item1;
            string i2 = keyValuesFixed[n].Item2;
            i1 = EditorGUILayout.TextField("Key " + n, i1);
            i2 = EditorGUILayout.TextField("Value " + n, i2);
            keyValuesFixed[n] = (i1, i2);
        }

        //
        // UI stuffs
        //
        protected bool groupEnabled;
        protected bool repaint = false;
        protected Vector2 scrollPos;
        protected Color ori;
        protected GUIStyle gsTest;

        public void Update()
        {
            if (repaint)
            {
                Repaint();
                repaint = false;
            }
        }

        void OnGUI()
        {
            ori = GUI.backgroundColor; // remember ori color

            gsTest = new GUIStyle("window");
            //gsTest.normal.textColor = WorldStorageWindow.arfColors[0];
            gsTest.fontStyle = FontStyle.Bold;
            gsTest.alignment = TextAnchor.UpperLeft;
            gsTest.fontSize = 16;

            scrollPos = EditorGUILayout.BeginScrollView(scrollPos, GUILayout.ExpandWidth(true));
            WorldStorageWindow.DrawCopyright();

            DrawUIStuffs();

            EditorGUILayout.EndScrollView();

            if (GUILayout.Button("Close Window"))
            {
                Close();
            }
        }

        public abstract void DrawUIStuffs();

        public virtual void GetParams()
        {
        }

        public virtual void AddObject()
        {
        }

        public virtual T GenerateObject()
        {
            return default(T);
        }
    }
}
 No newline at end of file
+14 −0
Original line number Diff line number Diff line
fileFormatVersion: 2
guid: b879c85f4eccbee40a78e1a01aaf77ca
MonoImporter:
  externalObjects: {}
  serializedVersion: 2
  defaultReferences:
  - m_ViewDataDictionary: {instanceID: 0}
  - worldStorageServer: {fileID: 11400000, guid: 4f997253243de534dad12937f1284975, type: 2}
  - worldStorageUser: {instanceID: 0}
  executionOrder: 0
  icon: {instanceID: 0}
  userData: 
  assetBundleName: 
  assetBundleVariant: 
+84 −64
Original line number Diff line number Diff line
@@ -34,21 +34,15 @@ using ETSI.ARF.OpenAPI.WorldStorage;

namespace ETSI.ARF.WorldStorage.UI
{
    public class TrackableWindow : EditorWindow
    public class TrackableWindow : BaseWindow<Trackable>
    {
        static public TrackableWindow winSingleton;

        [HideInInspector] public WorldStorageServer worldStorageServer;
        [HideInInspector] public WorldStorageUser worldStorageUser;

        [SerializeField] public List<string> trackables = new List<string>();

        bool groupEnabled;

        // Trackable params
        string UUID = System.Guid.Empty.ToString();
        string customName = "NotDefined";
        string creatorUUID = System.Guid.Empty.ToString();
        double confidence = 0f;
        TrackableType type = TrackableType.OTHER;
        UnitSystem unit = UnitSystem.CM;
        Vector3 trackableSize;
@@ -56,20 +50,16 @@ namespace ETSI.ARF.WorldStorage.UI
        Vector3 localCRS_rot;
        byte[] trackablePayload = new byte[1] { 0 };

        [SerializeField] KeyvalueTagList keyValueTags = new KeyvalueTagList();
        string key1 = "";
        string value1 = "";

        // UI stuffs
        private Vector2 scrollPos;
        private Color ori;
        private GUIStyle gsTest;

        //graph params to generate the node
        public bool useCoord;
        public float nodePosX = 0;
        public float nodePosY = 0;

        public TrackableWindow()
        {
            // init somne stuffs
        }

        public static void ShowWindow(WorldStorageServer ws, WorldStorageUser user, string UUID = "")
        {
            winSingleton = EditorWindow.GetWindow(typeof(TrackableWindow), false, "ETSI ARF - Trackable") as TrackableWindow;
@@ -78,12 +68,12 @@ namespace ETSI.ARF.WorldStorage.UI
            if (!string.IsNullOrEmpty(UUID))
            {
                winSingleton.UUID = UUID;
                winSingleton.GetTrackableParams();
                winSingleton.GetParams();
            }
            else
            {
                // Create new one
                winSingleton.AddTrackable();
                winSingleton.AddObject();
            }
        }

@@ -108,11 +98,6 @@ namespace ETSI.ARF.WorldStorage.UI
            return visual;
        }

        public TrackableWindow()
        {
            // init somne stuffs
        }

        void OnGUI()
        {
            ori = GUI.backgroundColor; // remember ori color
@@ -126,7 +111,7 @@ namespace ETSI.ARF.WorldStorage.UI
            scrollPos = EditorGUILayout.BeginScrollView(scrollPos, GUILayout.ExpandWidth(true));
            WorldStorageWindow.DrawCopyright();

            DrawTrackableStuffs();
            DrawUIStuffs();

            EditorGUILayout.EndScrollView();

@@ -136,7 +121,7 @@ namespace ETSI.ARF.WorldStorage.UI
            }
        }

        void DrawTrackableStuffs()// Trackable trackable)
        public override void DrawUIStuffs()// Trackable trackable)
        {
            GUILayout.BeginVertical(); // "Trackable Editor", gsTest);
            EditorGUILayout.Space();
@@ -157,11 +142,12 @@ namespace ETSI.ARF.WorldStorage.UI
            GUILayout.Label("User: " + worldStorageUser.userName, EditorStyles.whiteLargeLabel);
            EditorGUILayout.Space();

            customName = EditorGUILayout.TextField("Name of Trackable:", customName);
#if isDEBUG
            GUILayout.Label("UUID: " + UUID, EditorStyles.miniLabel); // readonly
            GUILayout.Label("Creator UID: " + creatorUUID, EditorStyles.miniLabel); // readonly
            EditorGUILayout.Space();
#endif
            customName = EditorGUILayout.TextField("Name of Trackable:", customName);
            EditorGUILayout.Space();

            // ---------------------
@@ -175,7 +161,7 @@ namespace ETSI.ARF.WorldStorage.UI

                if (!string.IsNullOrEmpty(UUID) && UUID != "0" && UUID != System.Guid.Empty.ToString())
                {
                    Trackable obj = GenerateTrackable();
                    Trackable obj = GenerateObject();
                    TrackableRequest.UpdateTrackableAsync(worldStorageServer, obj, (response) =>
                    {
                        UUID = response.result;
@@ -184,7 +170,7 @@ namespace ETSI.ARF.WorldStorage.UI
                        if (WorldStorageWindow.WorldStorageWindowSingleton != null)
                        {
                            WorldStorageWindow.WorldStorageWindowSingleton.GetTrackables();
                            WorldStorageWindow.WorldStorageWindowSingleton.Repaint();
                            WorldStorageWindow.WorldStorageWindowSingleton.repaint = true;
                        }
                        Close();
                    });
@@ -193,6 +179,8 @@ namespace ETSI.ARF.WorldStorage.UI

            GUI.backgroundColor = WorldStorageWindow.arfColors[3];
            if (GUILayout.Button("Delete"))
            {
                if (EditorUtility.DisplayDialog("Delete", "Are you sure you want to delete this Trackable?", "Delete", "Cancel"))
                {
                    Debug.Log("Delete Trackable");
                    TrackableRequest.DeleteTrackableAsync(worldStorageServer, Guid.Parse(UUID), (response) =>
@@ -200,16 +188,18 @@ namespace ETSI.ARF.WorldStorage.UI
                        UUID = System.Guid.Empty.ToString();
                        customName = "Warning: Object deleted !";
                        creatorUUID = System.Guid.Empty.ToString();
                        confidence = 0f;
                        type = TrackableType.OTHER;
                        unit = UnitSystem.CM;
                        if (WorldStorageWindow.WorldStorageWindowSingleton != null)
                        {
                            WorldStorageWindow.WorldStorageWindowSingleton.GetTrackables();
                        WorldStorageWindow.WorldStorageWindowSingleton.Repaint();
                            WorldStorageWindow.WorldStorageWindowSingleton.repaint = true;
                        }
                        Close();
                    });
                }
            }
            GUI.backgroundColor = ori;

            GUI.backgroundColor = WorldStorageWindow.arfColors[5];
@@ -226,6 +216,7 @@ namespace ETSI.ARF.WorldStorage.UI
            // ---------------------
            type = (TrackableType)EditorGUILayout.EnumPopup("Trackable Type:", type);
            unit = (UnitSystem)EditorGUILayout.EnumPopup("Unit System:", unit);
            confidence = EditorGUILayout.DoubleField("Confidence:", confidence);

            EditorGUILayout.Space();
            trackableSize = EditorGUILayout.Vector3Field("Trackable Size:", trackableSize);
@@ -246,17 +237,26 @@ namespace ETSI.ARF.WorldStorage.UI
                }
            }

            // ---------------------
            // Keyvalues
            // ---------------------
            EditorGUILayout.Space();
            groupEnabled = EditorGUILayout.BeginToggleGroup("Optional Parameters:", groupEnabled);
            key1 = EditorGUILayout.TextField("Key 1", key1);
            value1 = EditorGUILayout.TextField("Value 1", value1);
            if (keyValuesFixed.Count > 0)
            {
                OutputKeyValue(0);
                OutputKeyValue(1);
                OutputKeyValue(2);
            }
            EditorGUILayout.EndToggleGroup();
            //
            GUILayout.EndVertical();
        }

        private void GetTrackableParams()
        public override void GetParams()
        {
            customName = "Requesting information...";

            TrackableRequest.GetTrackableAsync(worldStorageServer, Guid.Parse(UUID), (response) =>
            {
                Trackable obj = response.result;
@@ -264,6 +264,7 @@ namespace ETSI.ARF.WorldStorage.UI
                creatorUUID = obj.CreatorUUID.ToString();
                type = obj.TrackableType;
                unit = obj.Unit;
                confidence = obj.Confidence;
                if (obj.TrackableSize.Count == 3)
                {
                    trackableSize = new Vector3((float)obj.TrackableSize[0], (float)obj.TrackableSize[1], (float)obj.TrackableSize[2]);
@@ -282,32 +283,44 @@ namespace ETSI.ARF.WorldStorage.UI
                    localCRS_rot = Vector3.zero;
                }

                // Read a key value (demo)
                var first = WorldStorageWindow.GetFirstKeyValueTags(obj.KeyvalueTags);
                key1 = first.Item1;
                value1 = first.Item2;
                // ---------------------
                // Keyvalues
                // ---------------------
                //var first = WorldStorageWindow.GetFirstKeyValueTags(obj.KeyvalueTags);
                //keyValuesFixed.Clear(); // no
                for (int i = 0; i < keyValuesFixed.Count; i++) keyValuesFixed[i] = ("", "");

                this.Repaint();
                if (obj.KeyvalueTags.Count > 0)
                {
                    int cnt = 0;
                    foreach (var item in obj.KeyvalueTags)
                    {
                        if (item.Key == "unityAuthoringPosX" || item.Key == "unityAuthoringPosY") continue; // ignore internal params
                        if (cnt < keyValuesFixed.Count) keyValuesFixed[cnt] = (item.Key, item.Value[0]);
                        cnt++;
                    }
                }
                repaint = true;
            });
        }

        public void AddTrackable()
        public override void AddObject()
        {
            Debug.Log("POST Trackable");
            UUID = System.Guid.Empty.ToString();
            customName = "Default Trackable";

            Trackable obj = GenerateTrackable();
            Trackable obj = GenerateObject();
            TrackableRequest.CreateTrackableAsync(worldStorageServer, obj, (response) =>
            {
                UUID = response.result;
                UUID = UUID.Trim('"'); //Bugfix: remove " from server return value
                WorldStorageWindow.WorldStorageWindowSingleton.GetTrackables();
                WorldStorageWindow.WorldStorageWindowSingleton.Repaint();
                WorldStorageWindow.WorldStorageWindowSingleton.repaint = true;
            });
        }

        public Trackable GenerateTrackable()
        public override Trackable GenerateObject()
        {
            EncodingInformationStructure trackableEncodingInformation = new EncodingInformationStructure()
            {
@@ -327,9 +340,23 @@ namespace ETSI.ARF.WorldStorage.UI
            localCRS = Matrix4x4.TRS(localCRS_pos, Quaternion.Euler(localCRS_rot), Vector3.one);
            Transform3D _localCRS = WorldStorageUnityHelper.ConvertUnityToETSIARFTransform3D(localCRS);

            // Create a key value (one from demo)
            // Remember the position of the Unity graph node
            var posX = new Collection<String>();
            posX.Add(nodePosX.ToString());
            var posY = new Collection<String>();
            posY.Add(nodePosY.ToString());

            // ---------------------
            // Keyvalues
            // ---------------------
            keyValueTags.Clear();
            keyValueTags.Add(key1, new Collection<string> { value1 });
            keyValueTags.Add("unityAuthoringPosX", posX);
            keyValueTags.Add("unityAuthoringPosY", posY);
            if (keyValuesFixed.Count > 0)
                foreach (var item in keyValuesFixed)
                {
                    if (!string.IsNullOrEmpty(item.Item1)) keyValueTags.Add(item.Item1, new Collection<string> { item.Item2 });
                }

            System.Guid _uuid = System.Guid.Parse(UUID);
            System.Guid _creator = System.Guid.Parse(worldStorageUser.UUID);
@@ -342,17 +369,10 @@ namespace ETSI.ARF.WorldStorage.UI
                TrackablePayload = trackablePayload,
                LocalCRS = _localCRS,
                Unit = unit,
                Confidence = confidence,
                TrackableSize = _trackableSize,
                KeyvalueTags = keyValueTags
            };

            var posX = new Collection<String>();
            posX.Add(nodePosX.ToString());
            t.KeyvalueTags["unityAuthoringPosX"] = posX;
            var posY = new Collection<String>();
            posY.Add(nodePosY.ToString());
            t.KeyvalueTags["unityAuthoringPosY"] = posY;

            return t;
        }
    }
+76 −65
Original line number Diff line number Diff line
@@ -34,17 +34,10 @@ using ETSI.ARF.OpenAPI.WorldStorage;

namespace ETSI.ARF.WorldStorage.UI
{
    public class WorldAnchorWindow : EditorWindow
    public class WorldAnchorWindow : BaseWindow<WorldAnchor>
    {
        static public WorldAnchorWindow winSingleton;

        [HideInInspector] public WorldStorageServer worldStorageServer;
        [HideInInspector] public WorldStorageUser worldStorageUser;

        [SerializeField] public List<string> anchors = new List<string>();

        bool groupEnabled;

        // World Anchors params
        string UUID = System.Guid.Empty.ToString();
        string customName = "NotDefined";
@@ -54,20 +47,16 @@ namespace ETSI.ARF.WorldStorage.UI
        Vector3 localCRS_pos;
        Vector3 localCRS_rot;

        [SerializeField] KeyvalueTagList keyValueTags = new KeyvalueTagList();
        string key1 = "";
        string value1 = "";

        // UI stuffs
        private Vector2 scrollPos;
        private Color ori;
        private GUIStyle gsTest;

        //graph params to generate the node
        public bool useCoord;
        public float nodePosX = 0;
        public float nodePosY = 0;

        public WorldAnchorWindow()
        {
            // init somne stuffs
        }

        public static void ShowWindow(WorldStorageServer ws, WorldStorageUser user, string UUID = "")
        {
            winSingleton = EditorWindow.GetWindow(typeof(WorldAnchorWindow), false, "ETSI ARF - World Anchor") as WorldAnchorWindow;
@@ -76,12 +65,12 @@ namespace ETSI.ARF.WorldStorage.UI
            if (!string.IsNullOrEmpty(UUID))
            {
                winSingleton.UUID = UUID;
                winSingleton.GetWorldAnchorParams();
                winSingleton.GetParams();
            }
            else
            {
                // Create new one
                winSingleton.AddAnchor();
                winSingleton.AddObject();
            }
        }

@@ -106,11 +95,6 @@ namespace ETSI.ARF.WorldStorage.UI
            return visual;
        }

        public WorldAnchorWindow()
        {
            // init somne stuffs
        }

        void OnGUI()
        {
            ori = GUI.backgroundColor; // remember ori color
@@ -124,7 +108,7 @@ namespace ETSI.ARF.WorldStorage.UI
            scrollPos = EditorGUILayout.BeginScrollView(scrollPos, GUILayout.ExpandWidth(true));
            WorldStorageWindow.DrawCopyright();

            DrawAnchorStuffs();
            DrawUIStuffs();

            EditorGUILayout.EndScrollView();

@@ -134,7 +118,7 @@ namespace ETSI.ARF.WorldStorage.UI
            }
        }

        void DrawAnchorStuffs()
        public override void DrawUIStuffs()
        {
            GUILayout.BeginVertical(); // "World Anchor Editor", gsTest);
            EditorGUILayout.Space();
@@ -155,11 +139,12 @@ namespace ETSI.ARF.WorldStorage.UI
            GUILayout.Label("User: " + worldStorageUser.userName, EditorStyles.whiteLargeLabel);
            EditorGUILayout.Space();

            customName = EditorGUILayout.TextField("Name of Anchor:", customName);
#if isDEBUG
            GUILayout.Label("UUID: " + UUID, EditorStyles.miniLabel); // readonly
            GUILayout.Label("Creator UID: " + creatorUUID, EditorStyles.miniLabel); // readonly
            EditorGUILayout.Space();
#endif
            customName = EditorGUILayout.TextField("Name of Anchor:", customName);
            EditorGUILayout.Space();

            // ---------------------
@@ -173,23 +158,25 @@ namespace ETSI.ARF.WorldStorage.UI

                if (!string.IsNullOrEmpty(UUID) && UUID != "0" && UUID != System.Guid.Empty.ToString())
                {
                    WorldAnchor obj = GenerateWorldAnchor();
                    WorldAnchor obj = GenerateObject();
                    WorldAnchorRequest.UpdateWorldAnchorAsync(worldStorageServer, obj, (response) =>
                    {
                        UUID = response.result;
                        UUID = UUID.Trim('"'); //Bugfix: remove " from server return value

                        if (WorldStorageWindow.WorldStorageWindowSingleton != null)
                        {
                            WorldStorageWindow.WorldStorageWindowSingleton.GetWorldAnchors();
                            WorldStorageWindow.WorldStorageWindowSingleton.Repaint();
                        }
                        Close();
                    });
                }
                Close();
            }

            GUI.backgroundColor = WorldStorageWindow.arfColors[3];
            if (GUILayout.Button("Delete"))
            {
                if (EditorUtility.DisplayDialog("Delete", "Are you sure you want to delete this World Anchor?", "Delete", "Cancel"))
                {
                    Debug.Log("Delete World Anchor");
                    WorldAnchorRequest.DeleteWorldAnchorAsync(worldStorageServer, Guid.Parse(UUID), (response) =>
@@ -201,11 +188,11 @@ namespace ETSI.ARF.WorldStorage.UI
                        if (WorldStorageWindow.WorldStorageWindowSingleton != null)
                        {
                            WorldStorageWindow.WorldStorageWindowSingleton.GetWorldAnchors();
                        WorldStorageWindow.WorldStorageWindowSingleton.Repaint();
                        }
                        Close();
                    });
                }
            }
            GUI.backgroundColor = ori;

            GUI.backgroundColor = WorldStorageWindow.arfColors[5];
@@ -230,16 +217,23 @@ namespace ETSI.ARF.WorldStorage.UI
            localCRS_pos = EditorGUILayout.Vector3Field("   Position:", localCRS_pos);
            localCRS_rot = EditorGUILayout.Vector3Field("   Rotation:", localCRS_rot);

            // ---------------------
            // Keyvalues
            // ---------------------
            EditorGUILayout.Space();
            groupEnabled = EditorGUILayout.BeginToggleGroup("Optional Parameters:", groupEnabled);
            key1 = EditorGUILayout.TextField("Key 1", key1);
            value1 = EditorGUILayout.TextField("Value 1", value1);
            if (keyValuesFixed.Count > 0)
            {
                OutputKeyValue(0);
                OutputKeyValue(1);
                OutputKeyValue(2);
            }
            EditorGUILayout.EndToggleGroup();
            //
            GUILayout.EndVertical();
        }

        private void GetWorldAnchorParams()
        public override void GetParams()
        {
            WorldAnchorRequest.GetWorldAnchorAsync(worldStorageServer, Guid.Parse(UUID), (response) =>
            {
@@ -265,32 +259,43 @@ namespace ETSI.ARF.WorldStorage.UI
                    localCRS_rot = Vector3.zero;
                }

                // Read a key value (demo)
                var first = WorldStorageWindow.GetFirstKeyValueTags(obj.KeyvalueTags);
                key1 = first.Item1;
                value1 = first.Item2;
                // ---------------------
                // Keyvalues
                // ---------------------
                //var first = WorldStorageWindow.GetFirstKeyValueTags(obj.KeyvalueTags);
                //keyValuesFixed.Clear(); // no
                for (int i = 0; i < keyValuesFixed.Count; i++) keyValuesFixed[i] = ("", "");

                this.Repaint();
                if (obj.KeyvalueTags.Count > 0)
                {
                    int cnt = 0;
                    foreach (var item in obj.KeyvalueTags)
                    {
                        if (item.Key == "unityAuthoringPosX" || item.Key == "unityAuthoringPosY") continue; // ignore internal params
                        if (cnt < keyValuesFixed.Count) keyValuesFixed[cnt] = (item.Key, item.Value[0]);
                        cnt++;
                    }
                }
                repaint = true;
            });
        }

        public void AddAnchor()
        public override void AddObject()
        {
            Debug.Log("POST World Anchor");
            UUID = System.Guid.Empty.ToString();
            customName = "Default Anchor";

            WorldAnchor obj = GenerateWorldAnchor();
            WorldAnchor obj = GenerateObject();
            WorldAnchorRequest.CreateWorldAnchorAsync(worldStorageServer, obj, (response) =>
            {
                UUID = response.result;
                UUID = UUID.Trim('"'); //Bugfix: remove " from server return value
                WorldStorageWindow.WorldStorageWindowSingleton.GetWorldAnchors();
                WorldStorageWindow.WorldStorageWindowSingleton.Repaint();
            });
        }

        public WorldAnchor GenerateWorldAnchor()
        public override WorldAnchor GenerateObject()
        {
            Size _worldAnchorSize = new Size();
            _worldAnchorSize.Add(worldAnchorSize.x);
@@ -302,9 +307,23 @@ namespace ETSI.ARF.WorldStorage.UI
            localCRS = Matrix4x4.TRS(localCRS_pos, Quaternion.Euler(localCRS_rot), Vector3.one);
            Transform3D _localCRS = WorldStorageUnityHelper.ConvertUnityToETSIARFTransform3D(localCRS);

            // Create a key value (one from demo)
            // Remember the position of the Unity graph node
            var posX = new Collection<String>();
            posX.Add(nodePosX.ToString());
            var posY = new Collection<String>();
            posY.Add(nodePosY.ToString());

            // ---------------------
            // Keyvalues
            // ---------------------
            keyValueTags.Clear();
            keyValueTags.Add(key1, new Collection<string> { value1 });
            keyValueTags.Add("unityAuthoringPosX", posX);
            keyValueTags.Add("unityAuthoringPosY", posY);
            if (keyValuesFixed.Count > 0)
                foreach (var item in keyValuesFixed)
                {
                    if (!string.IsNullOrEmpty(item.Item1)) keyValueTags.Add(item.Item1, new Collection<string> { item.Item2 });
                }

            Guid _uuid = Guid.Parse(UUID);
            Guid _creator = Guid.Parse(worldStorageUser.UUID);
@@ -317,14 +336,6 @@ namespace ETSI.ARF.WorldStorage.UI
                WorldAnchorSize = _worldAnchorSize,
                KeyvalueTags = keyValueTags
            };

            var posX = new Collection<String>();
            posX.Add(nodePosX.ToString());
            t.KeyvalueTags["unityAuthoringPosX"] = posX;
            var posY = new Collection<String>();
            posY.Add(nodePosY.ToString());
            t.KeyvalueTags["unityAuthoringPosY"] = posY;

            return t;
        }
    }
+73 −49

File changed.

Preview size limit exceeded, changes collapsed.

Loading