From 3ec771d8e1df26e750f93bab36d7c8b9def97bf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Je=CC=81re=CC=81my=20Lacoche?= <jeremy.lacoche@orange.com> Date: Wed, 18 Dec 2024 13:38:29 +0100 Subject: [PATCH] Now 4 key values can be edited (todo: any number), fix issue request https with unitywebrequest --- Editor/Scripts/Windows/BaseWindow.cs | 4 ++-- Editor/Scripts/Windows/TrackableWindow.cs | 1 + Runtime/Scripts/OpenAPI/UnityWebRequestHttpClient.cs | 5 ++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Editor/Scripts/Windows/BaseWindow.cs b/Editor/Scripts/Windows/BaseWindow.cs index 64bba1e..fac183c 100644 --- a/Editor/Scripts/Windows/BaseWindow.cs +++ b/Editor/Scripts/Windows/BaseWindow.cs @@ -45,9 +45,9 @@ namespace ETSI.ARF.WorldStorage.UI // Keyvalues // [SerializeField] protected KeyvalueTagList keyValueTags = new KeyvalueTagList(); - protected List<(string, string)> keyValuesFixed = new List<(string, string)>(3) + protected List<(string, string)> keyValuesFixed = new List<(string, string)>(4) { - ("", ""),("", ""),("", "") + ("", ""),("", ""),("", ""),("", "") }; protected void OutputKeyValue(int n) { diff --git a/Editor/Scripts/Windows/TrackableWindow.cs b/Editor/Scripts/Windows/TrackableWindow.cs index c5d8f57..4135be0 100644 --- a/Editor/Scripts/Windows/TrackableWindow.cs +++ b/Editor/Scripts/Windows/TrackableWindow.cs @@ -247,6 +247,7 @@ namespace ETSI.ARF.WorldStorage.UI OutputKeyValue(0); OutputKeyValue(1); OutputKeyValue(2); + OutputKeyValue(3); } EditorGUILayout.EndToggleGroup(); // diff --git a/Runtime/Scripts/OpenAPI/UnityWebRequestHttpClient.cs b/Runtime/Scripts/OpenAPI/UnityWebRequestHttpClient.cs index 43fd7f0..fb8a7af 100644 --- a/Runtime/Scripts/OpenAPI/UnityWebRequestHttpClient.cs +++ b/Runtime/Scripts/OpenAPI/UnityWebRequestHttpClient.cs @@ -108,9 +108,8 @@ namespace ETSI.ARF.OpenAPI.WorldStorage { try { - List<string> li = item.Value as List<string>; - if (item.Key == "token") webRequest.SetRequestHeader(item.Key, li[0].ToString()); // add it - if (item.Key == "sessionID") webRequest.SetRequestHeader(item.Key, li[0].ToString()); // add it + List<string> li = item.Value.ToList<string>(); + webRequest.SetRequestHeader(item.Key, li[0]); // assume only one value } catch { } // ignore it } -- GitLab