Преглед изворни кода

Mer databasanrop för online spel

Axel Nordh пре 6 година
родитељ
комит
a82d0cce9e

+ 24 - 9
Assets/MainMenu.unity

@@ -739,6 +739,7 @@ GameObject:
   - component: {fileID: 103181451}
   - component: {fileID: 103181450}
   - component: {fileID: 103181452}
+  - component: {fileID: 103181449}
   m_Layer: 5
   m_Name: OnlineGamesPanel
   m_TagString: Untagged
@@ -767,6 +768,19 @@ RectTransform:
   m_AnchoredPosition: {x: 0, y: 0}
   m_SizeDelta: {x: 0, y: 0}
   m_Pivot: {x: 1, y: 1}
+--- !u!114 &103181449
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 103181447}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: acdfd3ec6b2f4a1498d0a188104fa1bb, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  questionCardPrefab: {fileID: 0}
 --- !u!114 &103181450
 MonoBehaviour:
   m_ObjectHideFlags: 0
@@ -2644,7 +2658,7 @@ RectTransform:
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0, y: 1}
   m_AnchorMax: {x: 1, y: 1}
-  m_AnchoredPosition: {x: -0.000045776367, y: -0.000015996158}
+  m_AnchoredPosition: {x: -0.000045776367, y: 11.001662}
   m_SizeDelta: {x: 0, y: 0}
   m_Pivot: {x: 0.5, y: 1}
 --- !u!114 &321314050
@@ -5665,7 +5679,7 @@ RectTransform:
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0, y: 1}
   m_AnchorMax: {x: 1, y: 1}
-  m_AnchoredPosition: {x: -0.000015258789, y: -0.000015996158}
+  m_AnchoredPosition: {x: -0.000015258789, y: 11.001662}
   m_SizeDelta: {x: 0, y: 0}
   m_Pivot: {x: 0.5, y: 1}
 --- !u!114 &777178507
@@ -7363,8 +7377,8 @@ MonoBehaviour:
   m_TargetGraphic: {fileID: 761483707}
   m_HandleRect: {fileID: 761483706}
   m_Direction: 2
-  m_Value: 1
-  m_Size: 1
+  m_Value: 0
+  m_Size: 0.94356734
   m_NumberOfSteps: 0
   m_OnValueChanged:
     m_PersistentCalls:
@@ -8600,7 +8614,7 @@ RectTransform:
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0, y: 1}
   m_AnchorMax: {x: 0, y: 1}
-  m_AnchoredPosition: {x: 0, y: -0.000019490055}
+  m_AnchoredPosition: {x: 0, y: -0.00003561596}
   m_SizeDelta: {x: 0, y: 0}
   m_Pivot: {x: 0, y: 1}
 --- !u!114 &1273003562
@@ -10278,7 +10292,7 @@ MonoBehaviour:
   m_TargetGraphic: {fileID: 1808633002}
   m_HandleRect: {fileID: 1808633001}
   m_Direction: 3
-  m_Value: 1
+  m_Value: 0
   m_Size: 1
   m_NumberOfSteps: 0
   m_OnValueChanged:
@@ -10938,8 +10952,8 @@ MonoBehaviour:
   m_TargetGraphic: {fileID: 359479520}
   m_HandleRect: {fileID: 359479519}
   m_Direction: 2
-  m_Value: 1
-  m_Size: 1
+  m_Value: 0
+  m_Size: 0.94356734
   m_NumberOfSteps: 0
   m_OnValueChanged:
     m_PersistentCalls:
@@ -11249,7 +11263,8 @@ MonoBehaviour:
     type: 3}
   onlineGamePrefab: {fileID: 4443270113283690094, guid: 7f480eea4df9d6b4a8174b27a5f06df2,
     type: 3}
-  finishedGamePrefab: {fileID: 0}
+  finishedGamePrefab: {fileID: 4443270113283690094, guid: 7f480eea4df9d6b4a8174b27a5f06df2,
+    type: 3}
 --- !u!1 &1698485521
 GameObject:
   m_ObjectHideFlags: 0

+ 18 - 18
Assets/Prefab/OnlineGame.prefab

@@ -10,7 +10,6 @@ GameObject:
   m_Component:
   - component: {fileID: 4443270112465168312}
   - component: {fileID: 4443270112465168293}
-  - component: {fileID: 4443270112465168294}
   - component: {fileID: 4443270112465168295}
   m_Layer: 5
   m_Name: StatusText
@@ -46,19 +45,6 @@ CanvasRenderer:
   m_PrefabAsset: {fileID: 0}
   m_GameObject: {fileID: 4443270112465168313}
   m_CullTransparentMesh: 0
---- !u!114 &4443270112465168294
-MonoBehaviour:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 4443270112465168313}
-  m_Enabled: 1
-  m_EditorHideFlags: 0
-  m_Script: {fileID: 11500000, guid: 539bd096d40d9934d916d02e161ee660, type: 3}
-  m_Name: 
-  m_EditorClassIdentifier: 
-  key: ONLINE_GAME_STATUS_TITLE
 --- !u!114 &4443270112465168295
 MonoBehaviour:
   m_ObjectHideFlags: 0
@@ -179,6 +165,7 @@ GameObject:
   m_Component:
   - component: {fileID: 4443270113229645986}
   - component: {fileID: 4443270113229645999}
+  - component: {fileID: 7593177373378014699}
   - component: {fileID: 4443270113229645985}
   m_Layer: 5
   m_Name: StatusValueText
@@ -214,6 +201,19 @@ CanvasRenderer:
   m_PrefabAsset: {fileID: 0}
   m_GameObject: {fileID: 4443270113229645987}
   m_CullTransparentMesh: 0
+--- !u!114 &7593177373378014699
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 4443270113229645987}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 539bd096d40d9934d916d02e161ee660, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  key: TITLE_PLACEHOLDER
 --- !u!114 &4443270113229645985
 MonoBehaviour:
   m_ObjectHideFlags: 0
@@ -247,7 +247,7 @@ MonoBehaviour:
     m_HorizontalOverflow: 0
     m_VerticalOverflow: 0
     m_LineSpacing: 1
-  m_Text: Placeholder Text
+  m_Text: Undefined
 --- !u!1 &4443270113283690094
 GameObject:
   m_ObjectHideFlags: 0
@@ -367,7 +367,7 @@ MonoBehaviour:
   m_Name: 
   m_EditorClassIdentifier: 
   gameStatusText: {fileID: 4443270113439902654}
-  gameTitleText: {fileID: 4443270112465168295}
+  gameTitleText: {fileID: 4443270113229645985}
   gameStatus: 
 --- !u!114 &8384964256862483610
 MonoBehaviour:
@@ -421,7 +421,7 @@ MonoBehaviour:
   m_PrefabInstance: {fileID: 0}
   m_PrefabAsset: {fileID: 0}
   m_GameObject: {fileID: 4443270113283690094}
-  m_Enabled: 1
+  m_Enabled: 0
   m_EditorHideFlags: 0
   m_Script: {fileID: 11500000, guid: 78e7dcec242b8e54db8994e443fcf679, type: 3}
   m_Name: 
@@ -519,7 +519,7 @@ MonoBehaviour:
     m_HorizontalOverflow: 0
     m_VerticalOverflow: 0
     m_LineSpacing: 1
-  m_Text: New Text
+  m_Text: Undefined
 --- !u!1 &4443270113653808760
 GameObject:
   m_ObjectHideFlags: 0

+ 10 - 2
Assets/Scripts/CategoryPanel.cs

@@ -24,7 +24,11 @@ public class CategoryPanel : MonoBehaviour
 
     private void PopulatePanel() {
         if (categories == null) {
-            categories = Database.Instance.GetCategories();
+            if (PlayerPrefs.GetString("GameMode").Equals("Local")) {
+                Database.Instance.GetCategories(categories);
+            } else if (PlayerPrefs.GetString("GameMode").Equals("Online")) {
+                OnlineDatabase.Instance.GetCategories(categories);
+            }
         }
         foreach (Category cat in categories) {
             AddText(cat.name, cat.color);
@@ -48,7 +52,11 @@ public class CategoryPanel : MonoBehaviour
 
     public Category GetCategoryById(int id) {
         if (categories == null) {
-            categories = Database.Instance.GetCategories();
+            if (PlayerPrefs.GetString("GameMode").Equals("Local")) {
+                Database.Instance.GetCategories(categories);
+            } else if (PlayerPrefs.GetString("GameMode").Equals("Online")) {
+                OnlineDatabase.Instance.GetCategories(categories);
+            }
         }
         foreach (Category cat in categories) {
             if (cat.id == id) {

+ 8 - 0
Assets/Scripts/Database.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: eb631aa84606ccf47ae7bd9eb38ebd33
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 36 - 163
Assets/Scripts/Database.cs → Assets/Scripts/Database/Database.cs

@@ -29,8 +29,7 @@ public class Database : MonoBehaviour {
         }
     }
 
-    internal List<CategoryPanel.Category> GetCategories() {
-        List<CategoryPanel.Category> list = new List<CategoryPanel.Category>();
+    internal void GetCategories(List<CategoryPanel.Category> list) {
         string sql = "SELECT name, r, g, b, a, id FROM category";
         IDbCommand cmd = GetConnection();
         cmd.CommandText = sql;
@@ -51,23 +50,6 @@ public class Database : MonoBehaviour {
             list.Add(cat);
         }
         CloseConnection();
-        return list;
-    }
-
-    internal void SetupNewOnlineGame(int limitPerQuestion, int limitPerPlayer, int toWin, List<InviteSearchResult> inviteUsers) {
-        List<int> playerIds = new List<int>();
-        inviteUsers.ForEach(i => playerIds.Add(i.GetId()));
-        int currentUser = Database.Instance.GetSignedInUser().Key;
-        playerIds.Add(currentUser);
-
-        var form = new WWWForm();
-        form.AddField("currentUser", currentUser);
-        form.AddField("winNumber", toWin);
-        form.AddField("limitPerQuestion", limitPerQuestion);
-        form.AddField("limitPerPlayer", limitPerPlayer);
-        form.AddField("playerIds", String.Join(",", playerIds));
-
-        Debug.Log(CallOnlineDatabaseWithResponse("NewOnlineGame.php", form));
     }
 
     [Serializable]
@@ -94,6 +76,21 @@ public class Database : MonoBehaviour {
         public List<PlayerInfo> playerInfoList = new List<PlayerInfo>();
     }
 
+    [Serializable]
+    public class Category {
+        public int r;
+        public int g;
+        public int b;
+        public int a;
+        public int id;
+        public string name;
+    }
+
+    [Serializable]
+    public class Categories {
+        public List<Category> categoryList = new List<Category>();
+    }
+
     [Serializable]
     public class OnlineGame {
         public string id;
@@ -112,7 +109,7 @@ public class Database : MonoBehaviour {
     public class OnlineGames {
         public List<OnlineGame> onlineGamesList = new List<OnlineGame>();
     }
- 
+
     [Serializable]
     public class UserName {
         public string id;
@@ -124,37 +121,10 @@ public class Database : MonoBehaviour {
         public List<UserName> usernamesList = new List<UserName>();
     }
 
-    private void CallDatabase(string filename, WWWForm formData) {
-        string postUrl = serverUrl + filename;
-
-        UnityWebRequest www = UnityWebRequest.Post(postUrl, formData);
-        www.SendWebRequest();
-
-        if (www.isNetworkError || www.isHttpError) {
-            Debug.Log(www.error);
-        } else {
-            while (!www.isDone) {
-            }
-        }
-    }
-
-    private string CallOnlineDatabaseWithResponse(string filename, WWWForm formData) {
-        string postUrl = serverUrl + filename;
-
-        UnityWebRequest www = UnityWebRequest.Post(postUrl, formData);
-        www.SendWebRequest();
+    internal void SetLastPlayedDate(int gameId) {
+        if (gameMode.Equals("Online")) {
 
-        if (www.isNetworkError || www.isHttpError) {
-            Debug.Log(www.error);
-        } else {
-            while (!www.isDone) {
-            }
         }
-
-        return www.downloadHandler.text;
-    }
-
-    internal void SetLastPlayedDate(int gameId) {
         string sql = "UPDATE game SET lastPlayedDate = DATE() WHERE id = " + gameId;
         IDbCommand cmd = GetConnection();
         cmd.CommandText = sql;
@@ -273,109 +243,7 @@ public class Database : MonoBehaviour {
         CloseConnection();
         return this.questionTimer;
     }
-
-    internal void DeclineOnlineGame(string userName, int gameId) {
-        WWWForm formData = new WWWForm();
-        formData.AddField("userId", -1);
-        formData.AddField("f", "decline");
-        formData.AddField("gameId", gameId);
-        formData.AddField("userName", userName);
-
-        CallDatabase("OnlineGames.php", formData);
-    }
-
-    internal void AcceptOnlineGame(string userName, int gameId) {
-        WWWForm formData = new WWWForm();
-        formData.AddField("userId", -1);
-        formData.AddField("f", "accept");
-        formData.AddField("gameId",  gameId);
-        formData.AddField("userName", userName);
-
-        CallDatabase("OnlineGames.php", formData);
-    }
-
-    internal List<OnlineGameScript> GetOnlineGames(int userId, string userName, GameObject prefab) {
-
-        WWWForm formData = new WWWForm();
-        formData.AddField("userId", userId);
-        formData.AddField("f", "list");
-        formData.AddField("gameId", -1);
-        formData.AddField("userName", userName);
-
-        string response = CallOnlineDatabaseWithResponse("OnlineGames.php", formData);
-
-        if (response.Equals("No games found for user")) {
-            return null;
-        }
-
-        response = "{\"onlineGamesList\" :  " + response + " }";
-
-        OnlineGames og = new OnlineGames();
-        JsonUtility.FromJsonOverwrite(response, og);
-
-        GameObject onlineGameObject;
-        OnlineGameScript ogs = null;
-        List<OnlineGameScript> games = new List<OnlineGameScript>();
-        foreach (OnlineGame game in og.onlineGamesList) {
-            onlineGameObject = Instantiate(prefab, new Vector2(0, 0), Quaternion.identity) as GameObject;
-            ogs = onlineGameObject.GetComponent<OnlineGameScript>();
-            ogs.SetGameStatus(game.status);
-            Int32.TryParse(game.id, out int gameId);
-            List<KeyValuePair<string, string>> playerInfos = GetGameInfo(gameId);
-            if (game.status.Equals("PENDING")) {
-                string extraInfo = "";
-                foreach (KeyValuePair<string, string> s in playerInfos) {
-                    if (s.Value.Equals("WAITING") && s.Key.Equals(userName)) {
-                        ogs.SetGameStatus("INVITED");
-                        extraInfo += s.Key + ",";
-                    } else if (s.Value.EndsWith("WAITING")) {
-                        extraInfo += s.Key + ",";
-                    }
-                }
-                extraInfo = extraInfo.TrimEnd(',');
-                ogs.SetGameStatusText(extraInfo);
-
-            } else if (game.status.Equals("OTHERS_TURN")) { // Wont work
-                ogs.SetGameStatusText(game.currentPlayer);
-            } else {
-                ogs.SetGameStatusText();
-            }
-
-            ogs.SetId(game.id);
-            ogs.SetWinNumber(game.winNumber);
-            ogs.SetAnswerTimer(game.answerTimer);
-            ogs.SetRoundTimeLimit(game.roundTimeLimit);
-            ogs.CurrentPlayer = game.currentPlayer;
-            ogs.SetRound(game.round);
-            ogs.StartDate = game.startDate;
-
-            games.Add(ogs);
-           ogs.PlayerInfos = playerInfos;
-        }
-
-        return games;
-    }
-
-    internal List<KeyValuePair<string, string>> GetGameInfo(int gameId) {
-        List<KeyValuePair<string, string>> returnList = new List<KeyValuePair<string, string>>();
-
-        WWWForm form = new WWWForm();
-        form.AddField("gameId", gameId);
-
-        string response = CallOnlineDatabaseWithResponse("OnlineGameInfo.php", form);
-
-        response = "{\"playerInfoList\" : " + response + " }";
-        PlayerInfos pi = new PlayerInfos();
-        JsonUtility.FromJsonOverwrite(response, pi);
-
-        foreach (PlayerInfo p in pi.playerInfoList) {
-            KeyValuePair<string, string> player = new KeyValuePair<string, string>(p.username, p.status);
-            returnList.Add(player);
-        }
-
-        return returnList;
-    }
-
+    
     internal List<LocalGameScript> GetLocalGames(GameObject prefab) {
         List<LocalGameScript> games = new List<LocalGameScript>();
         string sql = "SELECT game.*, name, localUsers.id as userId FROM game INNER JOIN localGamePlayers on game.id = localGamePlayers.gameId INNER JOIN localUsers on playerId = localUsers.id order by game.id ASC, userId ASC";
@@ -783,20 +651,25 @@ public class Database : MonoBehaviour {
     }
 
     public void SavePlayersQuestion(string questionId, string playerNameValue, int gameId) {
-        if (databaseUrl == null) {
-            SetLocalOrOnline(GetGameMode(gameId));
-        }
+        string gameMode = PlayerPrefs.GetString("GameMode");
+        SetLocalOrOnline(gameMode);
+
         Int32.TryParse(questionId, out int qId);
-        string sql = "INSERT OR IGNORE INTO usersLockedQuestions (playerName, questionId, gameId) VALUES ('" + playerNameValue + "'," + qId + "," + gameId + ")";
-        IDbConnection conn = new SqliteConnection(databaseUrl);
-        conn.Open();
-        IDbCommand cmd = conn.CreateCommand();
-        cmd.CommandText = sql;
 
-        cmd.ExecuteReader();
+        if (gameMode.Equals("Local")) {
+            string sql = "INSERT OR IGNORE INTO usersLockedQuestions (playerName, questionId, gameId) VALUES ('" + playerNameValue + "'," + qId + "," + gameId + ")";
+            IDbConnection conn = new SqliteConnection(databaseUrl);
+            conn.Open();
+            IDbCommand cmd = conn.CreateCommand();
+            cmd.CommandText = sql;
 
-        cmd.Dispose();
-        conn.Close();
+            cmd.ExecuteReader();
+
+            cmd.Dispose();
+            conn.Close();
+        } else {
+            // TODO Save question to database online;
+        }
     }
 
     public List<QuestionCard> GetPlayerQuestions(int gameId, string playerNameValue) {

+ 0 - 0
Assets/Scripts/Database.cs.meta → Assets/Scripts/Database/Database.cs.meta


+ 684 - 0
Assets/Scripts/Database/OnlineDatabase.cs

@@ -0,0 +1,684 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using Mono.Data.Sqlite;
+using System.Data;
+using System;
+using UnityEngine.Networking;
+using System.IO;
+
+public class OnlineDatabase : MonoBehaviour {
+    private const string onlineQuestionsUrl = "nordh.xyz/narKampen/dbFiles/Question.php";
+    private const string serverUrl = "nordh.xyz/narKampen/dbFiles/";
+    string databaseUrl;
+    string gameMode;
+    int winAmount = -1;
+    int questionTimer = -1;
+
+    public GameObject questionCardPrefab;
+
+    private static OnlineDatabase instance;
+    public static OnlineDatabase Instance { get { return instance; } }
+
+    private void Awake() {
+        if (instance == null) {
+            instance = this;
+        }
+    }
+
+    internal List<CategoryPanel.Category> GetCategories(List<CategoryPanel.Category> list) {
+        string response = CallOnlineDatabaseWithResponse("Categories.php", null);
+
+        response = "{\"categoryList\" :  " + response + " }";
+
+        Categories categories = new Categories();
+        Debug.Log(response);
+        JsonUtility.FromJsonOverwrite(response, categories);
+
+        foreach (Category c in categories.categoryList) {
+            CategoryPanel.Category cat = new CategoryPanel.Category();
+
+            cat.color = new Color32((byte)c.r, (byte)c.g, (byte)c.b, (byte)c.a);
+            cat.name = c.name;
+            cat.id = c.id;
+
+            list.Add(cat);
+        }
+        return list;
+    }
+
+    internal void SetupNewOnlineGame(int limitPerQuestion, int limitPerPlayer, int toWin, List<InviteSearchResult> inviteUsers) {
+        List<int> playerIds = new List<int>();
+        inviteUsers.ForEach(i => playerIds.Add(i.GetId()));
+        int currentUser = Database.Instance.GetSignedInUser().Key;
+        playerIds.Add(currentUser);
+
+        var form = new WWWForm();
+        form.AddField("currentUser", currentUser);
+        form.AddField("winNumber", toWin);
+        form.AddField("limitPerQuestion", limitPerQuestion);
+        form.AddField("limitPerPlayer", limitPerPlayer);
+        form.AddField("playerIds", String.Join(",", playerIds));
+
+        Debug.Log(CallOnlineDatabaseWithResponse("NewOnlineGame.php", form));
+    }
+
+    [Serializable]
+    public class Question {
+        public string question;
+        public string answer;
+        public string id;
+        public string category;
+    }
+
+    [Serializable]
+    public class Questions {
+        public List<Question> questionsList = new List<Question>();
+    }
+
+    [Serializable]
+    public class PlayerInfo {
+        public string username;
+        public string status;
+    }
+
+    [Serializable]
+    public class PlayerInfos {
+        public List<PlayerInfo> playerInfoList = new List<PlayerInfo>();
+    }
+
+    [Serializable]
+    public class GamePlayerInfo {
+        public string username;
+        public string userLockedQuestions;
+    }
+
+    [Serializable]
+    public class GamePlayerInfos {
+        public List<GamePlayerInfo> gamePlayerInfoList = new List<GamePlayerInfo>();
+    }
+
+
+
+    [Serializable]
+    public class Category {
+        public int r;
+        public int g;
+        public int b;
+        public int a;
+        public int id;
+        public string name;
+    }
+
+    [Serializable]
+    public class Categories {
+        public List<Category> categoryList = new List<Category>();
+    }
+
+    [Serializable]
+    public class OnlineGame {
+        public string id;
+        public string winNumber;
+        public string answerTimer;
+        public string roundTimeLimit;
+        public string currentPlayer;
+        public string round;
+        public string startDate;
+        public string LastPlayedDate;
+        public string finishedDate;
+        public string status;
+    }
+
+    [Serializable]
+    public class OnlineGames {
+        public List<OnlineGame> onlineGamesList = new List<OnlineGame>();
+    }
+
+    [Serializable]
+    public class UserName {
+        public string id;
+        public string username;
+    }
+
+    [Serializable]
+    public class UserNames {
+        public List<UserName> usernamesList = new List<UserName>();
+    }
+
+    private void CallDatabase(string filename, WWWForm formData) {
+        string postUrl = serverUrl + filename;
+
+        UnityWebRequest www = UnityWebRequest.Post(postUrl, formData);
+        www.SendWebRequest();
+
+        if (www.isNetworkError || www.isHttpError) {
+            Debug.Log(www.error);
+        } else {
+            while (!www.isDone) {
+            }
+        }
+    }
+
+    private string CallOnlineDatabaseWithResponse(string filename, WWWForm formData) {
+        string postUrl = serverUrl + filename;
+
+        UnityWebRequest www = UnityWebRequest.Post(postUrl, formData);
+        www.SendWebRequest();
+
+        if (www.isNetworkError || www.isHttpError) {
+            Debug.Log(www.error);
+        } else {
+            while (!www.isDone) {
+            }
+        }
+
+        return www.downloadHandler.text;
+    }
+
+    string questionString = "";
+    string answerString = "";
+    string idString = "";
+    string categoryString = "";
+    private int round = -1;
+    private string SearchString;
+
+    public string QuestionString { get => questionString; set => questionString = value; }
+
+
+    private void Start() {
+        if (instance == null) {
+            instance = this;
+        }
+    }
+
+    internal void SetLastPlayedDate(int gameId) {
+
+        WWWForm form = new WWWForm();
+        form.AddField("gameId", gameId);
+        form.AddField("f", "SetLastPlayed");
+        string response = CallOnlineDatabaseWithResponse("OnlineGames.php", form);
+
+        if (!response.Equals("")) {
+            Debug.Log(response);
+        }
+    }
+
+    internal void DeclineOnlineGame(string userName, int gameId) {
+        WWWForm formData = new WWWForm();
+        formData.AddField("userId", -1);
+        formData.AddField("f", "decline");
+        formData.AddField("gameId", gameId);
+        formData.AddField("userName", userName);
+
+        CallDatabase("OnlineGames.php", formData);
+    }
+
+    internal void AcceptOnlineGame(string userName, int gameId) {
+        WWWForm formData = new WWWForm();
+        formData.AddField("userId", -1);
+        formData.AddField("f", "accept");
+        formData.AddField("gameId", gameId);
+        formData.AddField("userName", userName);
+
+        CallDatabase("OnlineGames.php", formData);
+    }
+
+    internal List<OnlineGameScript> GetOnlineGames(int userId, string userName, GameObject prefab) {
+
+        WWWForm formData = new WWWForm();
+        formData.AddField("userId", userId);
+        formData.AddField("f", "list");
+        formData.AddField("gameId", -1);
+        formData.AddField("userName", userName);
+
+        string response = CallOnlineDatabaseWithResponse("OnlineGames.php", formData);
+
+        if (response.Equals("No games found for user")) {
+            return null;
+        }
+
+        response = "{\"onlineGamesList\" :  " + response + " }";
+
+        OnlineGames og = new OnlineGames();
+        JsonUtility.FromJsonOverwrite(response, og);
+
+        GameObject onlineGameObject;
+        OnlineGameScript ogs = null;
+        List<OnlineGameScript> games = new List<OnlineGameScript>();
+        foreach (OnlineGame game in og.onlineGamesList) {
+            onlineGameObject = Instantiate(prefab, new Vector2(0, 0), Quaternion.identity) as GameObject;
+            ogs = onlineGameObject.GetComponent<OnlineGameScript>();
+            ogs.CurrentPlayer = game.currentPlayer;
+            ogs.SetGameStatus(game.status);
+            Int32.TryParse(game.id, out int gameId);
+            List<KeyValuePair<string, string>> playerInfos = GetGameInfo(gameId);
+            if (game.status.Equals("PENDING")) {
+                string extraInfo = "";
+                foreach (KeyValuePair<string, string> s in playerInfos) {
+                    if (s.Value.Equals("WAITING") && s.Key.Equals(userName)) {
+                        ogs.SetGameStatus("INVITED");
+                        extraInfo += s.Key + ",";
+                    } else if (s.Value.EndsWith("WAITING")) {
+                        extraInfo += s.Key + ",";
+                    }
+                }
+                extraInfo = extraInfo.TrimEnd(',');
+                ogs.SetGameStatusText(extraInfo);
+
+            } else if (game.status.Equals("OTHERS_TURN")) { // Wont work
+                ogs.SetGameStatusText(game.currentPlayer);
+            } else if (game.status.Equals("ACTIVE")) {
+                ogs.SetGameStatusText(game.currentPlayer);
+            } else {
+                ogs.SetGameStatusText();
+            }
+
+            ogs.SetId(game.id);
+            ogs.SetWinNumber(game.winNumber);
+            ogs.SetAnswerTimer(game.answerTimer);
+            ogs.SetRoundTimeLimit(game.roundTimeLimit);
+            ogs.SetRound(game.round);
+            ogs.StartDate = game.startDate;
+
+            games.Add(ogs);
+            ogs.PlayerInfos = playerInfos;
+        }
+
+        return games;
+    }
+
+    internal List<KeyValuePair<string, string>> GetGameInfo(int gameId) {
+        List<KeyValuePair<string, string>> returnList = new List<KeyValuePair<string, string>>();
+
+        WWWForm form = new WWWForm();
+        form.AddField("gameId", gameId);
+
+        string response = CallOnlineDatabaseWithResponse("OnlineGameInfo.php", form);
+
+        response = "{\"playerInfoList\" : " + response + " }";
+        PlayerInfos pi = new PlayerInfos();
+        JsonUtility.FromJsonOverwrite(response, pi);
+
+        foreach (PlayerInfo p in pi.playerInfoList) {
+            KeyValuePair<string, string> player = new KeyValuePair<string, string>(p.username, p.status);
+            returnList.Add(player);
+        }
+
+        return returnList;
+    }
+
+    internal void SetQuestionsLost(int gameId, string playerName, int questionsLost) {
+        WWWForm form = new WWWForm();
+        form.AddField("f", "SetQuestionsLost");
+        form.AddField("questionsLost", questionsLost);
+        form.AddField("userName", playerName);
+        form.AddField("gameId", gameId);
+
+        string response = CallOnlineDatabaseWithResponse("OnlineGames.php", form);
+
+        if (!response.Equals("")) {
+            Debug.Log(response);
+        }
+    }
+
+    internal void RemoveGame(int gameId) {
+        WWWForm form = new WWWForm();
+        form.AddField("f", "DeleteGame");
+        form.AddField("gameId", gameId);
+
+        string response = CallOnlineDatabaseWithResponse("OnlineGames.php", form);
+
+        if (!response.Equals("")) {
+            Debug.Log(response);
+        }
+    }
+
+    public string GetCurrentPlayer(int gameId) {
+        WWWForm form = new WWWForm();
+        form.AddField("f", "CurrentPlayer");
+        form.AddField("gameId", gameId);
+
+        string response = CallOnlineDatabaseWithResponse("OnlineGames.php", form);
+        if (response.Equals("")) {
+            Debug.Log("Something wrong with current player for game with id: " + gameId);
+        }
+        return response;
+    }
+
+    public void SetCurrentPlayer(int gameId, string currentPlayer) {
+        WWWForm form = new WWWForm();
+        form.AddField("f", "SetCurrentPlayer");
+        form.AddField("gameId", gameId);
+        form.AddField("currentPlayer", currentPlayer);
+
+        string response = CallOnlineDatabaseWithResponse("OnlineGames.php", form);
+
+        if (!response.Equals("")) {
+            Debug.Log(response);
+        }
+    }
+
+    internal int GetPlayerPoints(int gameId, string playerName) {
+        WWWForm form = new WWWForm();
+        form.AddField("f", "GetPlayerPoints");
+        form.AddField("gameId", gameId);
+        form.AddField("userName", playerName);
+
+        string response = CallOnlineDatabaseWithResponse("OnlineGames.php", form);
+        if (response.Equals("")) {
+            Debug.Log("Something wrong with current player for game with id: " + gameId);
+        }
+        Int32.TryParse(response, out int playerPoints);
+        return playerPoints;
+    }
+
+    internal void SetFinishedDate(int gameId, string finishedDate) {
+        WWWForm form = new WWWForm();
+        form.AddField("f", "SetFinishedDate");
+        form.AddField("gameId", gameId);
+        form.AddField("finishedDate", finishedDate);
+
+        string response = CallOnlineDatabaseWithResponse("OnlineGames.php", form);
+
+        if (!response.Equals("")) {
+            Debug.Log(response);
+        }
+    }
+
+    internal void SetRoundValue(int gameId, int round) {
+        WWWForm form = new WWWForm();
+        form.AddField("f", "SetRound");
+        form.AddField("gameId", gameId);
+        form.AddField("round", round);
+
+        string response = CallOnlineDatabaseWithResponse("OnlineGames.php", form);
+
+        if (!response.Equals("")) {
+            Debug.Log(response);
+        }
+    }
+
+    internal int GetRoundValue(int gameId) {
+        WWWForm form = new WWWForm();
+        form.AddField("f", "GetRound");
+        form.AddField("gameId", gameId);
+
+        string response = CallOnlineDatabaseWithResponse("OnlineGames.php", form);
+        if (response.Equals("")) {
+            Debug.Log("Something wrong with getting current player for game with id: " + gameId);
+        }
+        Int32.TryParse(response, out int round);
+        return round;
+    }
+
+    internal List<KeyValuePair<string, int>> GetPlayersForGame(int gameId) {
+        WWWForm form = new WWWForm();
+        form.AddField("f", "GetPlayers");
+        form.AddField("gameId", gameId);
+
+        string response = CallOnlineDatabaseWithResponse("OnlineGames.php", form);
+        if (response.Equals("")) {
+            Debug.Log("Something wrong with getting players from game with id: " + gameId);
+        }
+
+        GamePlayerInfos gpi = new GamePlayerInfos();
+        JsonUtility.FromJsonOverwrite(response, gpi);
+
+        foreach (GamePlayerInfo p in gpi.gamePlayerInfoList) {
+            Int32.TryParse(p.userLockedQuestions, out int points);
+            KeyValuePair<string, int> player = new KeyValuePair<string, int>(p.username, points);
+
+        }
+        string sql = "SELECT name, (SELECT count(*) FROM usersLockedQuestions WHERE playerName = localUsers.name AND gameId = " + gameId + ") as numAnswers  FROM localGamePlayers " +
+            "LEFT JOIN localUsers ON localGamePlayers.playerId = localUsers.id " +
+            "WHERE gameId = " + gameId;
+        IDbConnection conn = new SqliteConnection(databaseUrl);
+        conn.Open();
+        IDbCommand cmd = conn.CreateCommand();
+        cmd.CommandText = sql;
+
+        IDataReader reader = cmd.ExecuteReader();
+
+        List<KeyValuePair<string, int>> returnList = new List<KeyValuePair<string, int>>();
+        while (reader.Read()) {
+            KeyValuePair<string, int> player = new KeyValuePair<string, int>(reader.GetString(0), reader.GetInt32(1));
+            returnList.Add(player);
+        }
+
+        return returnList;
+    }
+
+    public string AnswerString { get => answerString; set => answerString = value; }
+    public string IdString { get => idString; set => idString = value; }
+    public string CategoryString { get => categoryString; set => categoryString = value; }
+
+    internal int GetQuestionsLost(int gameId, string playerName) {
+        string sql = "SELECT questionsLost FROM localGamePlayers WHERE gameId = " + gameId + " AND playerId = (SELECT id from localUsers WHERE name = '" + playerName + "')";
+        IDbConnection conn = new SqliteConnection(databaseUrl);
+        conn.Open();
+        IDbCommand cmd = conn.CreateCommand();
+        cmd.CommandText = sql;
+        IDataReader reader = cmd.ExecuteReader();
+        int returnValue = 0;
+        while (reader.Read()) {
+            returnValue = reader.GetInt32(0);
+        }
+        reader.Close();
+        cmd.Dispose();
+        conn.Close();
+
+        return returnValue;
+    }
+
+    public string GetGameMode(int gameId) {
+        if (this.gameMode == null) {
+            string sql = "SELECT gameMode FROM game WHERE id = " + gameId;
+            IDbConnection conn = new SqliteConnection(databaseUrl);
+            conn.Open();
+            IDbCommand cmd = conn.CreateCommand();
+            cmd.CommandText = sql;
+            IDataReader reader = cmd.ExecuteReader();
+            while (reader.Read()) {
+                this.gameMode = reader.GetString(0);
+            }
+            reader.Close();
+            cmd.Dispose();
+            conn.Close();
+        }
+        return this.gameMode;
+    }
+
+    public void LinkPlayersToLocalGame(List<string> playerNames, int gameId) {
+
+        IDbConnection conn = new SqliteConnection(databaseUrl);
+        conn.Open();
+        string questionSql = "SELECT id FROM questions order by random() limit 1";
+        IDbCommand cmd = conn.CreateCommand();
+        cmd.CommandText = questionSql;
+        IDataReader reader = cmd.ExecuteReader();
+        int questionId = -1;
+        while (reader.Read()) {
+            questionId = reader.GetInt32(0);
+        }
+        foreach (string player in playerNames) {
+            string sql = "SELECT id FROM localUsers WHERE name = '" + player + "'";
+            int playerId;
+            cmd = conn.CreateCommand();
+            cmd.CommandText = sql;
+            reader = cmd.ExecuteReader();
+            if (reader.Read()) {
+                playerId = reader.GetInt32(0);
+            } else {
+                reader.Close();
+                sql = "INSERT INTO localUsers (name) VALUES ('" + player + "')";
+                cmd.CommandText = sql;
+                cmd.ExecuteNonQuery();
+
+                cmd.CommandText = "SELECT last_insert_rowid()";
+                Int64 lastInsert64 = (Int64)cmd.ExecuteScalar();
+                playerId = (int)lastInsert64;
+            }
+            cmd.Dispose();
+            reader.Close();
+
+            LinkPlayerToGame(playerId, gameId);
+            SavePlayersQuestion(questionId.ToString(), player, gameId);
+
+        }
+        IDbCommand cmd2 = conn.CreateCommand();
+        cmd2.CommandText = "UPDATE game SET currentPlayer = '" + playerNames[0] + "' WHERE id = " + gameId;
+        cmd2.ExecuteNonQuery();
+        cmd2.Dispose();
+        conn.Close();
+    }
+
+    private void LinkPlayerToGame(int playerId, int gameId) {
+        string sql = "INSERT INTO localGamePlayers (gameId, playerId) VALUES (" + gameId + ", " + playerId + ")";
+        SqliteConnection conn2 = new SqliteConnection(databaseUrl);
+        conn2.Open();
+        IDbCommand cmd = conn2.CreateCommand();
+        cmd.CommandText = sql;
+        cmd.ExecuteNonQuery();
+        cmd.Dispose();
+        conn2.Close();
+    }
+
+    internal int GetWinCondition(int gameId) {
+        if (winAmount == -1) {
+            string sql = "SELECT winNumber FROM game WHERE id = " + gameId;
+            IDbConnection conn = new SqliteConnection(databaseUrl);
+            conn.Open();
+            IDbCommand cmd = conn.CreateCommand();
+            cmd.CommandText = sql;
+            IDataReader reader = cmd.ExecuteReader();
+            while (reader.Read()) {
+                this.winAmount = reader.GetInt32(0);
+            }
+            reader.Close();
+            cmd.Dispose();
+            conn.Close();
+        }
+        return this.winAmount;
+    }
+
+    public NewQuestion GetNewQuestion(List<int> userAnsweredQuestions, string userName) {
+        int gameId = GameObject.Find("GameManager").GetComponent<GameManagerScript>().GameId;
+        Color32 questionCategoryColor = new Color32(0, 0, 20, 20);
+
+        StartCoroutine(GetQuestionData(false));
+        NewQuestion q = NewQuestion.Instance();
+        q.questionString = questionString;
+        q.answerString = answerString;
+        q.categoryString = categoryString;
+        q.idString = idString;
+        q.SetQuestionCategoryColor(questionCategoryColor);
+
+        return q;
+    }
+
+    public void SavePlayersQuestion(string questionId, string playerNameValue, int gameId) {
+        string gameMode = PlayerPrefs.GetString("GameMode");
+
+        Int32.TryParse(questionId, out int qId);
+
+        if (gameMode.Equals("Local")) {
+            string sql = "INSERT OR IGNORE INTO usersLockedQuestions (playerName, questionId, gameId) VALUES ('" + playerNameValue + "'," + qId + "," + gameId + ")";
+            IDbConnection conn = new SqliteConnection(databaseUrl);
+            conn.Open();
+            IDbCommand cmd = conn.CreateCommand();
+            cmd.CommandText = sql;
+
+            cmd.ExecuteReader();
+
+            cmd.Dispose();
+            conn.Close();
+        } else {
+            // TODO Save question to database online;
+        }
+    }
+
+    public List<QuestionCard> GetPlayerQuestions(int gameId, string playerNameValue) {
+        List<QuestionCard> questions = new List<QuestionCard>();
+
+        /*
+        if (connectionType.Equals("Local")) {
+            string sql = "SELECT * FROM questions inner join questionToCategory on questions.id = questionToCategory.questionId INNER JOIN category ON category.id = questionToCategory.categoryId WHERE questions.id IN ( SELECT questionId FROM usersLockedQuestions WHERE gameId = " + gameId + " AND playerName = '" + playerNameValue + "') ORDER BY answer ASC";
+            IDbConnection conn = new SqliteConnection(databaseUrl);
+            conn.Open();
+            IDbCommand cmd = conn.CreateCommand();
+            cmd.CommandText = sql;
+
+            IDataReader reader = cmd.ExecuteReader();
+            while (reader.Read()) {
+                GameObject question = Instantiate(questionCardPrefab, new Vector2(0, 0), Quaternion.identity) as GameObject;
+                QuestionCard q = question.GetComponent<QuestionCard>();
+
+                q.SetAnswerText(reader.GetInt32(2).ToString());
+                q.SetQuestionText(reader.GetString(1));
+                q.idString = reader.GetInt32(0).ToString();
+                Color32 questionCategoryColor = new Color32((byte)reader.GetInt32(7), (byte)reader.GetInt32(8), (byte)reader.GetInt32(9), (byte)reader.GetInt32(10));
+
+                q.SetQuestionCategoryColor(questionCategoryColor);
+
+                questions.Add(q);
+            }
+            cmd.Dispose();
+            conn.Close();
+        }
+        */
+        // TODO Fix online call to question
+        return questions;
+    }
+
+    private IEnumerator GetQuestionData(bool showAnswer) {
+        UnityWebRequest www = UnityWebRequest.Get("nordh.xyz/narKampen/dbFiles/Question.php");
+
+        yield return www.SendWebRequest();
+
+        if (www.isNetworkError || www.isHttpError) {
+            Debug.Log(www.error);
+        } else {
+            while (!www.isDone) {
+                yield return null;
+            }
+            // Show result
+            string jsonData = www.downloadHandler.text;
+
+            jsonData = "{\"questionsList\" : [ " + jsonData + " ]}";
+
+            Questions qe = new Questions();
+            JsonUtility.FromJsonOverwrite(jsonData, qe);
+
+            questionString = qe.questionsList[0].question;
+            answerString = qe.questionsList[0].answer;
+            idString = qe.questionsList[0].id;
+            categoryString = qe.questionsList[0].category;
+        }
+    }
+
+    public List<UserName> GetUsersToInvite(string searchString) {
+        string postUrl = "nordh.xyz/narKampen/dbFiles/PlayerSearch.php?";
+        postUrl += "search=" + UnityWebRequest.EscapeURL(searchString);
+
+
+        UserNames uNames = new UserNames();
+        UnityWebRequest www = UnityWebRequest.Get(postUrl);
+        www.SendWebRequest();
+
+        if (www.isNetworkError || www.isHttpError) {
+            Debug.Log(www.error);
+        } else {
+            while (!www.isDone) {
+            }
+            // Show result
+            string jsonData = www.downloadHandler.text;
+
+            jsonData = "{\"usernamesList\" :  " + jsonData + " }";
+
+            JsonUtility.FromJsonOverwrite(jsonData, uNames);
+        }
+        // TODO handle empty
+        return uNames.usernamesList;
+    }
+
+}

+ 11 - 0
Assets/Scripts/Database/OnlineDatabase.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: acdfd3ec6b2f4a1498d0a188104fa1bb
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 14 - 3
Assets/Scripts/GameInfoScript.cs

@@ -2,6 +2,7 @@
 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
+using UnityEngine.SceneManagement;
 using UnityEngine.UI;
 
 public class GameInfoScript : MonoBehaviour {
@@ -14,11 +15,15 @@ public class GameInfoScript : MonoBehaviour {
     public Transform playersPanel;
     public Transform gameSettingsPanel;
 
+    private int gameId;
+
     // Start is called before the first frame update
     void Start() {
         cancelButton.onClick.AddListener(Hide);
+        acceptButton.onClick.AddListener(OpenGame);
     }
 
+
     // Update is called once per frame
     void Update() {
 
@@ -26,11 +31,11 @@ public class GameInfoScript : MonoBehaviour {
 
     internal void SetOnlineData(OnlineGameScript onlineGameScript) {
         String currentPlayer = Database.Instance.GetSignedInUser().Value;
-
+        gameId = onlineGameScript.GetId();
         foreach (KeyValuePair<string, string> player in onlineGameScript.PlayerInfos) {
             GameObject slp = Instantiate(playerInfoPrefab, new Vector2(0, 0), Quaternion.identity) as GameObject;
             OnlinePlayerInfoScript opi = slp.GetComponent<OnlinePlayerInfoScript>();
-            opi.GameId = onlineGameScript.GetId();
+            opi.GameId = gameId;
             opi.SetPlayerName(player.Key);
             if (currentPlayer.Equals(player.Key) && player.Value.Equals("WAITING")) {
                 opi.ShowDecitionButtons();
@@ -43,12 +48,18 @@ public class GameInfoScript : MonoBehaviour {
 
         acceptButton.enabled = false;
         acceptButton.interactable = false;
-        if ("YOUR_TURN".Equals(onlineGameScript.GameStatus)) {
+        if ("ACTIVE".Equals(onlineGameScript.GameStatus)) {
             acceptButton.enabled = true;
             acceptButton.interactable = true;
         }
     }
 
+    private void OpenGame() {
+        PlayerPrefs.SetString("GameMode", "Online");
+        PlayerPrefs.SetInt("GameId", gameId);
+        SceneManager.LoadSceneAsync("narKampen");
+    }
+
     public void Show() {
         CanvasGroup cg = this.GetComponent<CanvasGroup>();
         cg.alpha = 1;

+ 11 - 4
Assets/Scripts/GameManagerScript.cs

@@ -9,6 +9,7 @@ public class GameManagerScript : MonoBehaviour {
     private string gameMode;
 
     public Database db;
+    public OnlineDatabase odb;
     StatsScript statsScript;
      
     public string GameMode { get => gameMode; set => gameMode = value; }
@@ -17,11 +18,17 @@ public class GameManagerScript : MonoBehaviour {
     List<KeyValuePair<string, int>> players;
     // Start is called before the first frame update
     void Start() {
-        db = Database.Instance;
         GameId = PlayerPrefs.GetInt("GameId");
-
-        db.SetLocalOrOnline("Local");
-        db.SetLastPlayedDate(GameId);
+        GameMode = PlayerPrefs.GetString("GameMode");
+
+        if (GameMode.Equals("Local")) {
+            db = Database.Instance;
+            db.SetLocalOrOnline(GameMode);
+            db.SetLastPlayedDate(GameId);
+        } else if (GameMode.Equals("Online")) {
+            odb = OnlineDatabase.Instance;
+            odb.SetLastPlayedDate(GameId);
+        }
         statsScript = GameObject.Find("StatsPanel").GetComponent<StatsScript>();
 
     }

+ 16 - 2
Assets/Scripts/Localization/TextLocalization.cs

@@ -3,21 +3,35 @@ using UnityEngine.UI;
 using System;
 
 [RequireComponent(typeof(Text))]
-public class TextLocalization : MonoBehaviour
-{
+public class TextLocalization : MonoBehaviour {
     public string key;
+    private string replaceText;
 
     void Start() {
         // Get the string value from localization manager from key 
         // and set the text component text value to the  returned string value 
         string text = LocalizationManager.Instance.GetText(key);
         text = text.Replace("\\n", Environment.NewLine);
+
+        if (replaceText != null) {
+            text = String.Format(text, replaceText);
+        }
+
         GetComponent<Text>().text = text;
     }
 
     public void UpdateText() {
         string text = LocalizationManager.Instance.GetText(key);
         text = text.Replace("\\n", Environment.NewLine);
+
+        if (replaceText != null) {
+            text = String.Format(text, replaceText);
+        }
+
         GetComponent<Text>().text = text;
     }
+
+    public void SetReplaceText(string value) {
+        replaceText = value;
+    }
 }

+ 3 - 10
Assets/Scripts/MainMenu.cs

@@ -53,7 +53,7 @@ public class MainMenu : MonoBehaviour {
 
         int onlineIndex = 1;
         if (checkInternetConnection()) {
-            List<OnlineGameScript> onlineGames = Database.Instance.GetOnlineGames(loggedInUser.Key, loggedInUser.Value, onlineGamePrefab);
+            List<OnlineGameScript> onlineGames = OnlineDatabase.Instance.GetOnlineGames(loggedInUser.Key, loggedInUser.Value, onlineGamePrefab);
             if (onlineGames != null) {
                 foreach (OnlineGameScript ogs in onlineGames) {
                     ogs.transform.SetParent(onlineGamesList, false);
@@ -144,14 +144,6 @@ public class MainMenu : MonoBehaviour {
         scrollPanel.verticalNormalizedPosition = 0f;
     }
 
-    private IEnumerator GetGamesFromServer() {
-        string postUrl = gamesPostUrl + "userId=" + loggedInUserId;
-
-        UnityWebRequest www = UnityWebRequest.Get(postUrl);
-
-        yield return www.SendWebRequest();
-    }
-
     private void StartNewGameAction() {
         ShowNewGamePanel();
     }
@@ -254,7 +246,8 @@ public class MainMenu : MonoBehaviour {
         }
 
         Database.Instance.LinkPlayersToLocalGame(playerNames, gameId);
- 
+
+        PlayerPrefs.SetString("GameMode", "Local");
         PlayerPrefs.SetInt("GameId", gameId);
         SceneManager.LoadSceneAsync("narKampen");
     }

+ 1 - 1
Assets/Scripts/NewOnlineGame.cs

@@ -47,7 +47,7 @@ public class NewOnlineGame : MonoBehaviour
         int timeLimitPlayer = GetInputFieldValue(timeLimitPerPlayer);
         int correctToWin = GetInputFieldValue(correctAnswersToWin);
         List<InviteSearchResult> inviteUsers = ips.GetSelectedUsersForInvite();
-        Database.Instance.SetupNewOnlineGame(timeLimitQuestion, timeLimitPlayer, correctToWin, inviteUsers);
+        OnlineDatabase.Instance.SetupNewOnlineGame(timeLimitQuestion, timeLimitPlayer, correctToWin, inviteUsers);
         
         // Reload Online Games panel, new prefab Online game pending.
     }

+ 19 - 3
Assets/Scripts/OnlineGameScript.cs

@@ -44,20 +44,24 @@ public class OnlineGameScript : MonoBehaviour {
         set {
             gameStatus = value;
             SetColor(gameStatus);
-            SetGameStatusText();
+
+            //SetGameStatusText();
         }
     }
 
     public List<KeyValuePair<string, string>> PlayerInfos { get => playerInfos; set => playerInfos = value; }
 
     private string PENDING_TITLE = "ONLINE_GAME_STATUS_TITLE_VALUE_PENDING";
+    private string ACTIVE_TITLE = "ONLINE_GAME_STATUS_TITLE_ACTIVE";
 
     private string PENDING = "ONLINE_GAME_STATUS_PENDING";
-    private string OTHERS_TURN = "ONLINE_GAME_STATUS_OTHERS_TURN";
     private string DECLINED = "ONLINE_GAME_STATUS_DECLINED";
-    private string YOUR_TURN = "ONLINE_GAME_STATUS_YOUR_TURN";
+    private string ACTIVE = "ONLINE_GAME_STATUS_ACTIVE";
     private string INVITED = "ONLINE_GAME_STATUS_INVITED";
 
+    private string OTHERS_TURN = "ONLINE_GAME_STATUS_OTHERS_TURN";
+    private string YOUR_TURN = "ONLINE_GAME_STATUS_YOUR_TURN";
+
     // behövs nog en partialy declined status också, om en av fyra tackar nej kanske man viss spela ändå.
     // behövs också en med dina inbjudningar.
 
@@ -89,6 +93,12 @@ public class OnlineGameScript : MonoBehaviour {
             image.color = statusColors[3];
         } else if ("INVITED".Equals(status)) {
             image.color = statusColors[4];
+        } else if ("ACTIVE".Equals(status)) {
+            if (CurrentPlayer.Equals(Database.Instance.GetSignedInUser().Value)) {
+                image.color = statusColors[2];
+            } else {
+                image.color = statusColors[1];
+            }
         } else {
             image.color = new Color32(100, 100, 100, 100);
         }
@@ -120,6 +130,12 @@ public class OnlineGameScript : MonoBehaviour {
         } else if ("INVITED".Equals(GameStatus)) {
             gameStatusText.gameObject.GetComponent<TextLocalization>().key = INVITED;
             gameStatusText.text = LocalizationManager.Instance.GetText(INVITED);
+        } else if ("ACTIVE".Equals(GameStatus)) {
+            TextLocalization textLocalization = gameStatusText.gameObject.GetComponent<TextLocalization>();
+            textLocalization.key = ACTIVE;
+            textLocalization.SetReplaceText(extraInfo);
+            gameTitleText.gameObject.GetComponent<TextLocalization>().key = ACTIVE_TITLE;
+            gameTitleText.text = LocalizationManager.Instance.GetText(ACTIVE_TITLE);
         } else { 
             gameStatusText.text = "SOMETHING WRONG WITH STATUS TITLE FROM TEXT " + GameStatus;
         }

+ 2 - 2
Assets/Scripts/OnlinePlayerInfoScript.cs

@@ -30,11 +30,11 @@ public class OnlinePlayerInfoScript : MonoBehaviour
     }
 
     private void DeclineGame() {
-        Database.Instance.DeclineOnlineGame(playerName.text, gameId);
+        OnlineDatabase.Instance.DeclineOnlineGame(playerName.text, gameId);
     }
 
     private void AcceptGame() {
-        Database.Instance.AcceptOnlineGame(playerName.text, gameId);
+        OnlineDatabase.Instance.AcceptOnlineGame(playerName.text, gameId);
     }
 
     public void SetPlayerName(string name) {

+ 2 - 2
Assets/Scripts/ScrollViewScript.cs

@@ -286,13 +286,13 @@ public class ScrollViewScript : MonoBehaviour, IDropHandler {
         dialog.SetTitle(LANG.GetText("TIMER_DIALOG_TITLE"));
         dialog.SetMessage(String.Format(message, GetUnlockedQuestionCount()));
         dialog.SetOnAccept(LANG.GetText("OK"), () => {
-            if (Database.Instance.GetGameMode(gameId).Equals("Local")) {
+            if (PlayerPrefs.GetString("GameMode").Equals("Local")) {
                 RemoveUnlockedQuestions();
                 ts.ResetTimer();
                 dialog.Hide();
                 NextPlayer();
             } else {
-                // online
+                // TODO online
             }
         });
         dialog.SetOnDecline("", () => dialog.Hide());

+ 2 - 0
Assets/Translations/ENGLISH.xml

@@ -75,11 +75,13 @@
   <text key="KEEP_SIGNED_IN_TEXT">Keep me signed in</text>
   <text key="ONLINE_GAME_STATUS_TITLE_VALUE_PENDING">Pending answers</text>
   <text key="ONLINE_GAME_STATUS_TITLE">Status</text>
+  <text key="ONLINE_GAME_STATUS_TITLE_ACTIVE">Active Game</text>
   <text key="ONLINE_GAME_STATUS_PENDING">Waiting for other player</text>
   <text key="ONLINE_GAME_STATUS_YOUR_TURN">Your turn</text>
   <text key="ONLINE_GAME_STATUS_ANOTHER_PLAYER">{0}s turn</text>
   <text key="ONLINE_GAME_STATUS_DECLINED">Game invite declined</text>
   <text key="ONLINE_GAME_STATUS_INVITED">You are invited</text>
+  <text key="ONLINE_GAME_STATUS_ACTIVE">{0}s turn</text>
   <text key="ONLINE_PLAYER_STATUS_WAITING">Waiting for answer</text>
   <text key="ONLINE_PLAYER_STATUS_ACCEPTED">Accepted</text>
   <text key="ONLINE_PLAYER_STATUS_DECLINED">Denied</text>

+ 2 - 0
Assets/Translations/SWEDISH.xml

@@ -76,11 +76,13 @@
   <text key="KEEP_SIGNED_IN_TEXT">Håll mig inloggad</text>
   <text key="ONLINE_GAME_STATUS_TITLE_VALUE_PENDING">Väntar svar</text>
   <text key="ONLINE_GAME_STATUS_TITLE">Status</text>
+  <text key="ONLINE_GAME_STATUS_TITLE_ACTIVE">Spelet igång</text>
   <text key="ONLINE_GAME_STATUS_PENDING">Väntar på andra spelare</text>
   <text key="ONLINE_GAME_STATUS_YOUR_TURN">Din tur</text>
   <text key="ONLINE_GAME_STATUS_ANOTHER_PLAYER">{0}s tur</text>
   <text key="ONLINE_GAME_STATUS_DECLINED">Spelet nekat</text>
   <text key="ONLINE_GAME_STATUS_INVITED">Du är inbjuden</text>
+  <text key="ONLINE_GAME_STATUS_ACTIVE">{0}s tur</text>
   <text key="ONLINE_PLAYER_STATUS_WAITING">Väntar på svar</text>
   <text key="ONLINE_PLAYER_STATUS_ACCEPTED">Accepterad</text>
   <text key="ONLINE_PLAYER_STATUS_DECLINED">Nekat</text>

+ 14 - 0
Assets/User.unity

@@ -694,6 +694,7 @@ GameObject:
   - component: {fileID: 151359095}
   - component: {fileID: 151359098}
   - component: {fileID: 151359099}
+  - component: {fileID: 151359100}
   m_Layer: 0
   m_Name: EventSystem
   m_TagString: Untagged
@@ -779,6 +780,19 @@ MonoBehaviour:
   m_Name: 
   m_EditorClassIdentifier: 
   questionCardPrefab: {fileID: 0}
+--- !u!114 &151359100
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 151359094}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: acdfd3ec6b2f4a1498d0a188104fa1bb, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  questionCardPrefab: {fileID: 0}
 --- !u!1 &231128496
 GameObject:
   m_ObjectHideFlags: 0

Разлика између датотеке није приказан због своје велике величине
+ 111 - 105
Assets/narKampen.unity


BIN
Assets/narKampenLocal.db


+ 752 - 0
ProjectSettings/InputManager.asset

@@ -293,3 +293,755 @@ InputManager:
     type: 0
     axis: 0
     joyNum: 0
+  - serializedVersion: 3
+    m_Name: XRI_Left_Primary2DAxis_Vertical
+    descriptiveName: Device joystick/touchpad horizontal motion
+    descriptiveNegativeName: 
+    negativeButton: 
+    positiveButton: 
+    altNegativeButton: 
+    altPositiveButton: 
+    gravity: 0
+    dead: 0.19
+    sensitivity: 1
+    snap: 0
+    invert: 0
+    type: 2
+    axis: 1
+    joyNum: 0
+  - serializedVersion: 3
+    m_Name: XRI_Left_Primary2DAxis_Horizontal
+    descriptiveName: Device joystick/touchpad horizontal motion
+    descriptiveNegativeName: 
+    negativeButton: 
+    positiveButton: 
+    altNegativeButton: 
+    altPositiveButton: 
+    gravity: 0
+    dead: 0.19
+    sensitivity: 1
+    snap: 0
+    invert: 0
+    type: 2
+    axis: 0
+    joyNum: 0
+  - serializedVersion: 3
+    m_Name: XRI_Left_Secondary2DAxis_Vertical
+    descriptiveName: Device joystick/touchpad horizontal motion.
+    descriptiveNegativeName: 
+    negativeButton: 
+    positiveButton: 
+    altNegativeButton: 
+    altPositiveButton: 
+    gravity: 0
+    dead: 0.19
+    sensitivity: 1
+    snap: 0
+    invert: 0
+    type: 2
+    axis: 17
+    joyNum: 0
+  - serializedVersion: 3
+    m_Name: XRI_Left_Secondary2DAxis_Horizontal
+    descriptiveName: Device joystick/touchpad horizontal motion
+    descriptiveNegativeName: 
+    negativeButton: 
+    positiveButton: 
+    altNegativeButton: 
+    altPositiveButton: 
+    gravity: 0
+    dead: 0.19
+    sensitivity: 1
+    snap: 0
+    invert: 0
+    type: 2
+    axis: 16
+    joyNum: 0
+  - serializedVersion: 3
+    m_Name: XRI_Left_Trigger
+    descriptiveName: Device trigger axis
+    descriptiveNegativeName: 
+    negativeButton: 
+    positiveButton: 
+    altNegativeButton: 
+    altPositiveButton: 
+    gravity: 0
+    dead: 0.001
+    sensitivity: 1
+    snap: 0
+    invert: 0
+    type: 2
+    axis: 8
+    joyNum: 0
+  - serializedVersion: 3
+    m_Name: XRI_Left_Grip
+    descriptiveName: Device grip axis
+    descriptiveNegativeName: 
+    negativeButton: 
+    positiveButton: 
+    altNegativeButton: 
+    altPositiveButton: 
+    gravity: 0
+    dead: 0.001
+    sensitivity: 1
+    snap: 0
+    invert: 0
+    type: 2
+    axis: 10
+    joyNum: 0
+  - serializedVersion: 3
+    m_Name: XRI_Left_IndexTouch
+    descriptiveName: Device index finger proximity touch axis.
+    descriptiveNegativeName: 
+    negativeButton: 
+    positiveButton: 
+    altNegativeButton: 
+    altPositiveButton: 
+    gravity: 0
+    dead: 0.19
+    sensitivity: 1
+    snap: 0
+    invert: 0
+    type: 2
+    axis: 12
+    joyNum: 0
+  - serializedVersion: 3
+    m_Name: XRI_Left_ThumbTouch
+    descriptiveName: Device thumb proximity touch axis
+    descriptiveNegativeName: 
+    negativeButton: 
+    positiveButton: 
+    altNegativeButton: 
+    altPositiveButton: 
+    gravity: 0
+    dead: 0.19
+    sensitivity: 1
+    snap: 0
+    invert: 0
+    type: 2
+    axis: 14
+    joyNum: 0
+  - serializedVersion: 3
+    m_Name: XRI_Left_PrimaryButton
+    descriptiveName: Device primary button
+    descriptiveNegativeName: 
+    negativeButton: 
+    positiveButton: joystick button 2
+    altNegativeButton: 
+    altPositiveButton: 
+    gravity: 1000
+    dead: 0.001
+    sensitivity: 1000
+    snap: 0
+    invert: 0
+    type: 0
+    axis: 0
+    joyNum: 0
+  - serializedVersion: 3
+    m_Name: XRI_Left_SecondaryButton
+    descriptiveName: Device secondary button
+    descriptiveNegativeName: 
+    negativeButton: 
+    positiveButton: joystick button 3
+    altNegativeButton: 
+    altPositiveButton: 
+    gravity: 1000
+    dead: 0.001
+    sensitivity: 1000
+    snap: 0
+    invert: 0
+    type: 0
+    axis: 0
+    joyNum: 0
+  - serializedVersion: 3
+    m_Name: XRI_Left_PrimaryTouch
+    descriptiveName: Device primary touch
+    descriptiveNegativeName: 
+    negativeButton: 
+    positiveButton: joystick button 12
+    altNegativeButton: 
+    altPositiveButton: 
+    gravity: 0
+    dead: 0
+    sensitivity: 0.1
+    snap: 0
+    invert: 0
+    type: 0
+    axis: 0
+    joyNum: 0
+  - serializedVersion: 3
+    m_Name: XRI_Left_SecondaryTouch
+    descriptiveName: Device secondary button
+    descriptiveNegativeName: 
+    negativeButton: 
+    positiveButton: joystick button 13
+    altNegativeButton: 
+    altPositiveButton: 
+    gravity: 0
+    dead: 0
+    sensitivity: 0.1
+    snap: 0
+    invert: 0
+    type: 0
+    axis: 0
+    joyNum: 0
+  - serializedVersion: 3
+    m_Name: XRI_Left_GripButton
+    descriptiveName: Device grip button
+    descriptiveNegativeName: 
+    negativeButton: 
+    positiveButton: joystick button 4
+    altNegativeButton: 
+    altPositiveButton: 
+    gravity: 0
+    dead: 0
+    sensitivity: 0.1
+    snap: 0
+    invert: 0
+    type: 0
+    axis: 0
+    joyNum: 0
+  - serializedVersion: 3
+    m_Name: XRI_Left_TriggerButton
+    descriptiveName: Device trigger button
+    descriptiveNegativeName: 
+    negativeButton: 
+    positiveButton: joystick button 14
+    altNegativeButton: 
+    altPositiveButton: 
+    gravity: 0
+    dead: 0
+    sensitivity: 0.1
+    snap: 0
+    invert: 0
+    type: 0
+    axis: 0
+    joyNum: 0
+  - serializedVersion: 3
+    m_Name: XRI_Left_MenuButton
+    descriptiveName: Device menu button
+    descriptiveNegativeName: 
+    negativeButton: 
+    positiveButton: joystick button 6
+    altNegativeButton: 
+    altPositiveButton: 
+    gravity: 1000
+    dead: 0.001
+    sensitivity: 1000
+    snap: 0
+    invert: 0
+    type: 0
+    axis: 0
+    joyNum: 0
+  - serializedVersion: 3
+    m_Name: XRI_Left_Primary2DAxisClick
+    descriptiveName: Device stick/touchpad click
+    descriptiveNegativeName: 
+    negativeButton: 
+    positiveButton: joystick button 8
+    altNegativeButton: 
+    altPositiveButton: 
+    gravity: 0
+    dead: 0
+    sensitivity: 0.1
+    snap: 0
+    invert: 0
+    type: 0
+    axis: 0
+    joyNum: 0
+  - serializedVersion: 3
+    m_Name: XRI_Left_Primary2DAxisTouch
+    descriptiveName: Device stick/touchpad touch
+    descriptiveNegativeName: 
+    negativeButton: 
+    positiveButton: joystick button 16
+    altNegativeButton: 
+    altPositiveButton: 
+    gravity: 0
+    dead: 0
+    sensitivity: 0.1
+    snap: 0
+    invert: 0
+    type: 0
+    axis: 0
+    joyNum: 0
+  - serializedVersion: 3
+    m_Name: XRI_Left_Thumbrest
+    descriptiveName: Device thumbrest
+    descriptiveNegativeName: 
+    negativeButton: 
+    positiveButton: joystick button 18
+    altNegativeButton: 
+    altPositiveButton: 
+    gravity: 0
+    dead: 0
+    sensitivity: 0.1
+    snap: 0
+    invert: 0
+    type: 0
+    axis: 0
+    joyNum: 0
+  - serializedVersion: 3
+    m_Name: XRI_Left_IndexFinger
+    descriptiveName: Left Index Finger for a Knuckles Style controller
+    descriptiveNegativeName: 
+    negativeButton: 
+    positiveButton: 
+    altNegativeButton: 
+    altPositiveButton: 
+    gravity: 0
+    dead: 0.001
+    sensitivity: 1
+    snap: 0
+    invert: 0
+    type: 2
+    axis: 20
+    joyNum: 0
+  - serializedVersion: 3
+    m_Name: XRI_Left_MiddleFinger
+    descriptiveName: Left Middle Finger for a Knuckles Style controller
+    descriptiveNegativeName: 
+    negativeButton: 
+    positiveButton: 
+    altNegativeButton: 
+    altPositiveButton: 
+    gravity: 0
+    dead: 0.001
+    sensitivity: 1
+    snap: 0
+    invert: 0
+    type: 2
+    axis: 22
+    joyNum: 0
+  - serializedVersion: 3
+    m_Name: XRI_Left_RingFinger
+    descriptiveName: Left Ring Finger for a Knuckles Style controller
+    descriptiveNegativeName: 
+    negativeButton: 
+    positiveButton: 
+    altNegativeButton: 
+    altPositiveButton: 
+    gravity: 0
+    dead: 0.001
+    sensitivity: 1
+    snap: 0
+    invert: 0
+    type: 2
+    axis: 24
+    joyNum: 0
+  - serializedVersion: 3
+    m_Name: XRI_Left_PinkyFinger
+    descriptiveName: Left Pinky Finger for a Knuckles Style controller
+    descriptiveNegativeName: 
+    negativeButton: 
+    positiveButton: 
+    altNegativeButton: 
+    altPositiveButton: 
+    gravity: 0
+    dead: 0.001
+    sensitivity: 1
+    snap: 0
+    invert: 0
+    type: 2
+    axis: 26
+    joyNum: 0
+  - serializedVersion: 3
+    m_Name: XRI_Right_Primary2DAxis_Vertical
+    descriptiveName: Device joystick/touchpad horizontal motion
+    descriptiveNegativeName: 
+    negativeButton: 
+    positiveButton: 
+    altNegativeButton: 
+    altPositiveButton: 
+    gravity: 0
+    dead: 0.19
+    sensitivity: 1
+    snap: 0
+    invert: 0
+    type: 2
+    axis: 4
+    joyNum: 0
+  - serializedVersion: 3
+    m_Name: XRI_Right_Primary2DAxis_Horizontal
+    descriptiveName: Device joystick/touchpad horizontal motion
+    descriptiveNegativeName: 
+    negativeButton: 
+    positiveButton: 
+    altNegativeButton: 
+    altPositiveButton: 
+    gravity: 0
+    dead: 0.19
+    sensitivity: 1
+    snap: 0
+    invert: 0
+    type: 2
+    axis: 3
+    joyNum: 0
+  - serializedVersion: 3
+    m_Name: XRI_Right_Secondary2DAxis_Vertical
+    descriptiveName: Device joystick/touchpad horizontal motion.
+    descriptiveNegativeName: 
+    negativeButton: 
+    positiveButton: 
+    altNegativeButton: 
+    altPositiveButton: 
+    gravity: 0
+    dead: 0.19
+    sensitivity: 1
+    snap: 0
+    invert: 0
+    type: 2
+    axis: 19
+    joyNum: 0
+  - serializedVersion: 3
+    m_Name: XRI_Right_Secondary2DAxis_Horizontal
+    descriptiveName: Device joystick/touchpad horizontal motion
+    descriptiveNegativeName: 
+    negativeButton: 
+    positiveButton: 
+    altNegativeButton: 
+    altPositiveButton: 
+    gravity: 0
+    dead: 0.19
+    sensitivity: 1
+    snap: 0
+    invert: 0
+    type: 2
+    axis: 18
+    joyNum: 0
+  - serializedVersion: 3
+    m_Name: XRI_Right_Trigger
+    descriptiveName: Device trigger axis
+    descriptiveNegativeName: 
+    negativeButton: 
+    positiveButton: 
+    altNegativeButton: 
+    altPositiveButton: 
+    gravity: 0
+    dead: 0.001
+    sensitivity: 1
+    snap: 0
+    invert: 0
+    type: 2
+    axis: 9
+    joyNum: 0
+  - serializedVersion: 3
+    m_Name: XRI_Right_Grip
+    descriptiveName: Device grip axis
+    descriptiveNegativeName: 
+    negativeButton: 
+    positiveButton: 
+    altNegativeButton: 
+    altPositiveButton: 
+    gravity: 0
+    dead: 0.001
+    sensitivity: 1
+    snap: 0
+    invert: 0
+    type: 2
+    axis: 11
+    joyNum: 0
+  - serializedVersion: 3
+    m_Name: XRI_Right_IndexTouch
+    descriptiveName: Device index finger proximity touch axis.
+    descriptiveNegativeName: 
+    negativeButton: 
+    positiveButton: 
+    altNegativeButton: 
+    altPositiveButton: 
+    gravity: 0
+    dead: 0.19
+    sensitivity: 1
+    snap: 0
+    invert: 0
+    type: 2
+    axis: 13
+    joyNum: 0
+  - serializedVersion: 3
+    m_Name: XRI_Right_ThumbTouch
+    descriptiveName: Device thumb proximity touch axis
+    descriptiveNegativeName: 
+    negativeButton: 
+    positiveButton: 
+    altNegativeButton: 
+    altPositiveButton: 
+    gravity: 0
+    dead: 0.19
+    sensitivity: 1
+    snap: 0
+    invert: 0
+    type: 2
+    axis: 15
+    joyNum: 0
+  - serializedVersion: 3
+    m_Name: XRI_Right_PrimaryButton
+    descriptiveName: Device primary button
+    descriptiveNegativeName: 
+    negativeButton: 
+    positiveButton: joystick button 0
+    altNegativeButton: 
+    altPositiveButton: 
+    gravity: 1000
+    dead: 0.001
+    sensitivity: 1000
+    snap: 0
+    invert: 0
+    type: 0
+    axis: 0
+    joyNum: 0
+  - serializedVersion: 3
+    m_Name: XRI_Right_SecondaryButton
+    descriptiveName: Device secondary button
+    descriptiveNegativeName: 
+    negativeButton: 
+    positiveButton: joystick button 1
+    altNegativeButton: 
+    altPositiveButton: 
+    gravity: 1000
+    dead: 0.001
+    sensitivity: 1000
+    snap: 0
+    invert: 0
+    type: 0
+    axis: 0
+    joyNum: 0
+  - serializedVersion: 3
+    m_Name: XRI_Right_PrimaryTouch
+    descriptiveName: Device primary touch
+    descriptiveNegativeName: 
+    negativeButton: 
+    positiveButton: joystick button 10
+    altNegativeButton: 
+    altPositiveButton: 
+    gravity: 0
+    dead: 0
+    sensitivity: 0.1
+    snap: 0
+    invert: 0
+    type: 0
+    axis: 0
+    joyNum: 0
+  - serializedVersion: 3
+    m_Name: XRI_Right_SecondaryTouch
+    descriptiveName: Device secondary button
+    descriptiveNegativeName: 
+    negativeButton: 
+    positiveButton: joystick button 11
+    altNegativeButton: 
+    altPositiveButton: 
+    gravity: 0
+    dead: 0
+    sensitivity: 0.1
+    snap: 0
+    invert: 0
+    type: 0
+    axis: 0
+    joyNum: 0
+  - serializedVersion: 3
+    m_Name: XRI_Right_GripButton
+    descriptiveName: Device grip button
+    descriptiveNegativeName: 
+    negativeButton: 
+    positiveButton: joystick button 5
+    altNegativeButton: 
+    altPositiveButton: 
+    gravity: 0
+    dead: 0
+    sensitivity: 0.1
+    snap: 0
+    invert: 0
+    type: 0
+    axis: 0
+    joyNum: 0
+  - serializedVersion: 3
+    m_Name: XRI_Right_TriggerButton
+    descriptiveName: Device trigger button
+    descriptiveNegativeName: 
+    negativeButton: 
+    positiveButton: joystick button 15
+    altNegativeButton: 
+    altPositiveButton: 
+    gravity: 0
+    dead: 0
+    sensitivity: 0.1
+    snap: 0
+    invert: 0
+    type: 0
+    axis: 0
+    joyNum: 0
+  - serializedVersion: 3
+    m_Name: XRI_Right_MenuButton
+    descriptiveName: Device menu button
+    descriptiveNegativeName: 
+    negativeButton: 
+    positiveButton: joystick button 7
+    altNegativeButton: 
+    altPositiveButton: 
+    gravity: 1000
+    dead: 0.001
+    sensitivity: 1000
+    snap: 0
+    invert: 0
+    type: 0
+    axis: 0
+    joyNum: 0
+  - serializedVersion: 3
+    m_Name: XRI_Right_Primary2DAxisClick
+    descriptiveName: Device stick/touchpad click
+    descriptiveNegativeName: 
+    negativeButton: 
+    positiveButton: joystick button 9
+    altNegativeButton: 
+    altPositiveButton: 
+    gravity: 0
+    dead: 0
+    sensitivity: 0.1
+    snap: 0
+    invert: 0
+    type: 0
+    axis: 0
+    joyNum: 0
+  - serializedVersion: 3
+    m_Name: XRI_Right_Primary2DAxisTouch
+    descriptiveName: Device stick/touchpad touch
+    descriptiveNegativeName: 
+    negativeButton: 
+    positiveButton: joystick button 17
+    altNegativeButton: 
+    altPositiveButton: 
+    gravity: 0
+    dead: 0
+    sensitivity: 0.1
+    snap: 0
+    invert: 0
+    type: 0
+    axis: 0
+    joyNum: 0
+  - serializedVersion: 3
+    m_Name: XRI_Right_Thumbrest
+    descriptiveName: Device thumbrest
+    descriptiveNegativeName: 
+    negativeButton: 
+    positiveButton: joystick button 19
+    altNegativeButton: 
+    altPositiveButton: 
+    gravity: 0
+    dead: 0
+    sensitivity: 0.1
+    snap: 0
+    invert: 0
+    type: 0
+    axis: 0
+    joyNum: 0
+  - serializedVersion: 3
+    m_Name: XRI_Right_IndexFinger
+    descriptiveName: Right Index Finger for a Knuckles Style controller
+    descriptiveNegativeName: 
+    negativeButton: 
+    positiveButton: 
+    altNegativeButton: 
+    altPositiveButton: 
+    gravity: 0
+    dead: 0.001
+    sensitivity: 1
+    snap: 0
+    invert: 0
+    type: 2
+    axis: 21
+    joyNum: 0
+  - serializedVersion: 3
+    m_Name: XRI_Right_MiddleFinger
+    descriptiveName: Right Middle Finger for a Knuckles Style controller
+    descriptiveNegativeName: 
+    negativeButton: 
+    positiveButton: 
+    altNegativeButton: 
+    altPositiveButton: 
+    gravity: 0
+    dead: 0.001
+    sensitivity: 1
+    snap: 0
+    invert: 0
+    type: 2
+    axis: 23
+    joyNum: 0
+  - serializedVersion: 3
+    m_Name: XRI_Right_RingFinger
+    descriptiveName: Right Ring Finger for a Knuckles Style controller
+    descriptiveNegativeName: 
+    negativeButton: 
+    positiveButton: 
+    altNegativeButton: 
+    altPositiveButton: 
+    gravity: 0
+    dead: 0.001
+    sensitivity: 1
+    snap: 0
+    invert: 0
+    type: 2
+    axis: 25
+    joyNum: 0
+  - serializedVersion: 3
+    m_Name: XRI_Right_PinkyFinger
+    descriptiveName: Right Pinky Finger for a Knuckles Style controller
+    descriptiveNegativeName: 
+    negativeButton: 
+    positiveButton: 
+    altNegativeButton: 
+    altPositiveButton: 
+    gravity: 0
+    dead: 0.001
+    sensitivity: 1
+    snap: 0
+    invert: 0
+    type: 2
+    axis: 27
+    joyNum: 0
+  - serializedVersion: 3
+    m_Name: XRI_Combined_Trigger
+    descriptiveName: Combined Trigger
+    descriptiveNegativeName: 
+    negativeButton: 
+    positiveButton: 
+    altNegativeButton: 
+    altPositiveButton: 
+    gravity: 0
+    dead: 0.19
+    sensitivity: 1
+    snap: 0
+    invert: 0
+    type: 2
+    axis: 2
+    joyNum: 0
+  - serializedVersion: 3
+    m_Name: XRI_DPad_Vertical
+    descriptiveName: Device directional pad. These values are replicated l/r
+    descriptiveNegativeName: 
+    negativeButton: 
+    positiveButton: 
+    altNegativeButton: 
+    altPositiveButton: 
+    gravity: 0
+    dead: 0.001
+    sensitivity: 1
+    snap: 0
+    invert: 0
+    type: 2
+    axis: 6
+    joyNum: 0
+  - serializedVersion: 3
+    m_Name: XRI_DPad_Horizontal
+    descriptiveName: Device directional pad. These values are replicated l/r
+    descriptiveNegativeName: 
+    negativeButton: 
+    positiveButton: 
+    altNegativeButton: 
+    altPositiveButton: 
+    gravity: 0
+    dead: 0.001
+    sensitivity: 1
+    snap: 0
+    invert: 0
+    type: 2
+    axis: 5
+    joyNum: 0

+ 7 - 0
UIElementsSchema/UIElements.xsd

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xs:schema xmlns:editor="UnityEditor.UIElements" xmlns:engine="UnityEngine.UIElements" xmlns="UnityEditor.PackageManager.UI" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+  <xs:import schemaLocation="UnityEngine.UIElements.xsd" namespace="UnityEngine.UIElements" />
+  <xs:import schemaLocation="UnityEditor.UIElements.xsd" namespace="UnityEditor.UIElements" />
+  <xs:import schemaLocation="UnityEditor.UIElements.Debugger.xsd" namespace="UnityEditor.UIElements.Debugger" />
+  <xs:import schemaLocation="UnityEditor.PackageManager.UI.xsd" namespace="UnityEditor.PackageManager.UI" />
+</xs:schema>

+ 275 - 0
UIElementsSchema/UnityEditor.PackageManager.UI.xsd

@@ -0,0 +1,275 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xs:schema xmlns:editor="UnityEditor.UIElements" xmlns:engine="UnityEngine.UIElements" xmlns="UnityEditor.PackageManager.UI" elementFormDefault="qualified" targetNamespace="UnityEditor.PackageManager.UI" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+  <xs:import schemaLocation="UnityEngine.UIElements.xsd" namespace="UnityEngine.UIElements" />
+  <xs:complexType name="AlertType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="false" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="Alert" substitutionGroup="engine:VisualElement" type="AlertType" />
+  <xs:complexType name="ArrowToggleType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="false" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="ArrowToggle" substitutionGroup="engine:VisualElement" type="ArrowToggleType" />
+  <xs:complexType name="LoadingSpinnerType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="false" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="LoadingSpinner" substitutionGroup="engine:VisualElement" type="LoadingSpinnerType" />
+  <xs:complexType name="PackageDependenciesType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="false" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="PackageDependencies" substitutionGroup="engine:VisualElement" type="PackageDependenciesType" />
+  <xs:complexType name="PackageDetailsType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="false" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="PackageDetails" substitutionGroup="engine:VisualElement" type="PackageDetailsType" />
+  <xs:complexType name="PackageGroupType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="false" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="PackageGroup" substitutionGroup="engine:VisualElement" type="PackageGroupType" />
+  <xs:complexType name="PackageItemType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="false" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="PackageItem" substitutionGroup="engine:VisualElement" type="PackageItemType" />
+  <xs:complexType name="PackageListType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="false" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="PackageList" substitutionGroup="engine:VisualElement" type="PackageListType" />
+  <xs:complexType name="PackageManagerToolbarType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="false" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="PackageManagerToolbar" substitutionGroup="engine:VisualElement" type="PackageManagerToolbarType" />
+  <xs:complexType name="PackageSampleListType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="false" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="PackageSampleList" substitutionGroup="engine:VisualElement" type="PackageSampleListType" />
+  <xs:complexType name="PackageStatusBarType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="false" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="PackageStatusBar" substitutionGroup="engine:VisualElement" type="PackageStatusBarType" />
+  <xs:complexType name="PackageToolbarType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="false" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="PackageToolbar" substitutionGroup="engine:VisualElement" type="PackageToolbarType" />
+  <xs:complexType name="DropdownButtonType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="false" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:attribute default="" name="text" type="xs:string" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="DropdownButton" substitutionGroup="engine:VisualElement" type="DropdownButtonType" />
+</xs:schema>

+ 27 - 0
UIElementsSchema/UnityEditor.UIElements.Debugger.xsd

@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xs:schema xmlns:editor="UnityEditor.UIElements" xmlns:engine="UnityEngine.UIElements" xmlns="UnityEditor.PackageManager.UI" elementFormDefault="qualified" targetNamespace="UnityEditor.UIElements.Debugger" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+  <xs:import schemaLocation="UnityEngine.UIElements.xsd" namespace="UnityEngine.UIElements" />
+  <xs:complexType name="EventTypeSelectFieldType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="true" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:attribute default="" name="binding-path" type="xs:string" use="optional" />
+        <xs:attribute default="" name="label" type="xs:string" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="EventTypeSelectField" substitutionGroup="engine:VisualElement" xmlns:q1="UnityEditor.UIElements.Debugger" type="q1:EventTypeSelectFieldType" />
+</xs:schema>

+ 856 - 0
UIElementsSchema/UnityEditor.UIElements.xsd

@@ -0,0 +1,856 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xs:schema xmlns:editor="UnityEditor.UIElements" xmlns:engine="UnityEngine.UIElements" xmlns="UnityEditor.PackageManager.UI" elementFormDefault="qualified" targetNamespace="UnityEditor.UIElements" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+  <xs:import schemaLocation="UnityEngine.UIElements.xsd" namespace="UnityEngine.UIElements" />
+  <xs:simpleType name="PropertyControl_value-type_Type">
+    <xs:restriction base="xs:string">
+      <xs:enumeration value="Long" />
+      <xs:enumeration value="Double" />
+      <xs:enumeration value="Int" />
+      <xs:enumeration value="Float" />
+      <xs:enumeration value="String" />
+    </xs:restriction>
+  </xs:simpleType>
+  <xs:complexType name="PropertyControlType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="true" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:attribute default="" name="binding-path" type="xs:string" use="optional" />
+        <xs:attribute default="" name="label" type="xs:string" use="optional" />
+        <xs:attribute name="value-type" type="editor:PropertyControl_value-type_Type" use="required" />
+        <xs:attribute default="" name="value" type="xs:string" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="PropertyControl" substitutionGroup="engine:VisualElement" type="editor:PropertyControlType" />
+  <xs:complexType name="VisualSplitterType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="false" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="VisualSplitter" substitutionGroup="engine:VisualElement" type="editor:VisualSplitterType" />
+  <xs:complexType name="ToolbarType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="false" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="Toolbar" substitutionGroup="engine:VisualElement" type="editor:ToolbarType" />
+  <xs:complexType name="ToolbarButtonType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="false" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:attribute default="" name="binding-path" type="xs:string" use="optional" />
+        <xs:attribute default="" name="text" type="xs:string" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="ToolbarButton" substitutionGroup="engine:VisualElement" type="editor:ToolbarButtonType" />
+  <xs:complexType name="ToolbarToggleType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="true" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:attribute default="" name="binding-path" type="xs:string" use="optional" />
+        <xs:attribute default="" name="label" type="xs:string" use="optional" />
+        <xs:attribute default="false" name="value" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="text" type="xs:string" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="ToolbarToggle" substitutionGroup="engine:VisualElement" type="editor:ToolbarToggleType" />
+  <xs:complexType name="ToolbarSpacerType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="false" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="ToolbarSpacer" substitutionGroup="engine:VisualElement" type="editor:ToolbarSpacerType" />
+  <xs:complexType name="ToolbarMenuType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="false" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:attribute default="" name="binding-path" type="xs:string" use="optional" />
+        <xs:attribute default="" name="text" type="xs:string" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="ToolbarMenu" substitutionGroup="engine:VisualElement" type="editor:ToolbarMenuType" />
+  <xs:complexType name="ToolbarSearchFieldType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="false" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="ToolbarSearchField" substitutionGroup="engine:VisualElement" type="editor:ToolbarSearchFieldType" />
+  <xs:complexType name="ToolbarPopupSearchFieldType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="false" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="ToolbarPopupSearchField" substitutionGroup="engine:VisualElement" type="editor:ToolbarPopupSearchFieldType" />
+  <xs:complexType name="ToolbarBreadcrumbsType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="false" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="ToolbarBreadcrumbs" substitutionGroup="engine:VisualElement" type="editor:ToolbarBreadcrumbsType" />
+  <xs:complexType name="PropertyFieldType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="false" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:attribute default="" name="binding-path" type="xs:string" use="optional" />
+        <xs:attribute default="" name="label" type="xs:string" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="PropertyField" substitutionGroup="engine:VisualElement" type="editor:PropertyFieldType" />
+  <xs:complexType name="InspectorElementType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="false" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:attribute default="" name="binding-path" type="xs:string" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="InspectorElement" substitutionGroup="engine:VisualElement" type="editor:InspectorElementType" />
+  <xs:complexType name="FloatFieldType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="true" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:attribute default="" name="binding-path" type="xs:string" use="optional" />
+        <xs:attribute default="" name="label" type="xs:string" use="optional" />
+        <xs:attribute default="0" name="value" type="xs:float" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="FloatField" substitutionGroup="engine:VisualElement" type="editor:FloatFieldType" />
+  <xs:complexType name="DoubleFieldType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="true" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:attribute default="" name="binding-path" type="xs:string" use="optional" />
+        <xs:attribute default="" name="label" type="xs:string" use="optional" />
+        <xs:attribute default="0" name="value" type="xs:double" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="DoubleField" substitutionGroup="engine:VisualElement" type="editor:DoubleFieldType" />
+  <xs:complexType name="IntegerFieldType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="true" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:attribute default="" name="binding-path" type="xs:string" use="optional" />
+        <xs:attribute default="" name="label" type="xs:string" use="optional" />
+        <xs:attribute default="0" name="value" type="xs:int" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="IntegerField" substitutionGroup="engine:VisualElement" type="editor:IntegerFieldType" />
+  <xs:complexType name="LongFieldType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="true" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:attribute default="" name="binding-path" type="xs:string" use="optional" />
+        <xs:attribute default="" name="label" type="xs:string" use="optional" />
+        <xs:attribute default="0" name="value" type="xs:long" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="LongField" substitutionGroup="engine:VisualElement" type="editor:LongFieldType" />
+  <xs:complexType name="CurveFieldType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="true" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:attribute default="" name="binding-path" type="xs:string" use="optional" />
+        <xs:attribute default="" name="label" type="xs:string" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="CurveField" substitutionGroup="engine:VisualElement" type="editor:CurveFieldType" />
+  <xs:complexType name="ObjectFieldType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="true" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:attribute default="" name="binding-path" type="xs:string" use="optional" />
+        <xs:attribute default="" name="label" type="xs:string" use="optional" />
+        <xs:attribute default="true" name="allow-scene-objects" type="xs:boolean" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="ObjectField" substitutionGroup="engine:VisualElement" type="editor:ObjectFieldType" />
+  <xs:complexType name="ColorFieldType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="true" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:attribute default="" name="binding-path" type="xs:string" use="optional" />
+        <xs:attribute default="" name="label" type="xs:string" use="optional" />
+        <xs:attribute default="RGBA(0.000, 0.000, 0.000, 1.000)" name="value" type="xs:string" use="optional" />
+        <xs:attribute default="true" name="show-eye-dropper" type="xs:boolean" use="optional" />
+        <xs:attribute default="true" name="show-alpha" type="xs:boolean" use="optional" />
+        <xs:attribute default="false" name="hdr" type="xs:boolean" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="ColorField" substitutionGroup="engine:VisualElement" type="editor:ColorFieldType" />
+  <xs:complexType name="EnumFieldType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="true" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:attribute default="" name="binding-path" type="xs:string" use="optional" />
+        <xs:attribute default="" name="label" type="xs:string" use="optional" />
+        <xs:attribute name="type" type="xs:string" use="required" />
+        <xs:attribute default="" name="value" type="xs:string" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="EnumField" substitutionGroup="engine:VisualElement" type="editor:EnumFieldType" />
+  <xs:complexType name="MaskFieldType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="true" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:attribute default="" name="binding-path" type="xs:string" use="optional" />
+        <xs:attribute default="" name="label" type="xs:string" use="optional" />
+        <xs:attribute default="" name="choices" type="xs:string" use="optional" />
+        <xs:attribute default="0" name="value" type="xs:int" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="MaskField" substitutionGroup="engine:VisualElement" type="editor:MaskFieldType" />
+  <xs:complexType name="LayerMaskFieldType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="true" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:attribute default="" name="binding-path" type="xs:string" use="optional" />
+        <xs:attribute default="" name="label" type="xs:string" use="optional" />
+        <xs:attribute default="" name="choices" type="xs:string" use="optional" />
+        <xs:attribute default="0" name="value" type="xs:int" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="LayerMaskField" substitutionGroup="engine:VisualElement" type="editor:LayerMaskFieldType" />
+  <xs:complexType name="LayerFieldType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="true" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:attribute default="" name="binding-path" type="xs:string" use="optional" />
+        <xs:attribute default="" name="label" type="xs:string" use="optional" />
+        <xs:attribute default="0" name="value" type="xs:int" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="LayerField" substitutionGroup="engine:VisualElement" type="editor:LayerFieldType" />
+  <xs:complexType name="TagFieldType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="true" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:attribute default="" name="binding-path" type="xs:string" use="optional" />
+        <xs:attribute default="" name="label" type="xs:string" use="optional" />
+        <xs:attribute default="" name="value" type="xs:string" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="TagField" substitutionGroup="engine:VisualElement" type="editor:TagFieldType" />
+  <xs:complexType name="GradientFieldType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="true" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:attribute default="" name="binding-path" type="xs:string" use="optional" />
+        <xs:attribute default="" name="label" type="xs:string" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="GradientField" substitutionGroup="engine:VisualElement" type="editor:GradientFieldType" />
+  <xs:complexType name="RectFieldType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="true" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:attribute default="" name="binding-path" type="xs:string" use="optional" />
+        <xs:attribute default="" name="label" type="xs:string" use="optional" />
+        <xs:attribute default="0" name="x" type="xs:float" use="optional" />
+        <xs:attribute default="0" name="y" type="xs:float" use="optional" />
+        <xs:attribute default="0" name="w" type="xs:float" use="optional" />
+        <xs:attribute default="0" name="h" type="xs:float" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="RectField" substitutionGroup="engine:VisualElement" type="editor:RectFieldType" />
+  <xs:complexType name="Vector2FieldType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="true" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:attribute default="" name="binding-path" type="xs:string" use="optional" />
+        <xs:attribute default="" name="label" type="xs:string" use="optional" />
+        <xs:attribute default="0" name="x" type="xs:float" use="optional" />
+        <xs:attribute default="0" name="y" type="xs:float" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="Vector2Field" substitutionGroup="engine:VisualElement" type="editor:Vector2FieldType" />
+  <xs:complexType name="Vector3FieldType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="true" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:attribute default="" name="binding-path" type="xs:string" use="optional" />
+        <xs:attribute default="" name="label" type="xs:string" use="optional" />
+        <xs:attribute default="0" name="x" type="xs:float" use="optional" />
+        <xs:attribute default="0" name="y" type="xs:float" use="optional" />
+        <xs:attribute default="0" name="z" type="xs:float" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="Vector3Field" substitutionGroup="engine:VisualElement" type="editor:Vector3FieldType" />
+  <xs:complexType name="Vector4FieldType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="true" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:attribute default="" name="binding-path" type="xs:string" use="optional" />
+        <xs:attribute default="" name="label" type="xs:string" use="optional" />
+        <xs:attribute default="0" name="x" type="xs:float" use="optional" />
+        <xs:attribute default="0" name="y" type="xs:float" use="optional" />
+        <xs:attribute default="0" name="z" type="xs:float" use="optional" />
+        <xs:attribute default="0" name="w" type="xs:float" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="Vector4Field" substitutionGroup="engine:VisualElement" type="editor:Vector4FieldType" />
+  <xs:complexType name="BoundsFieldType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="true" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:attribute default="" name="binding-path" type="xs:string" use="optional" />
+        <xs:attribute default="" name="label" type="xs:string" use="optional" />
+        <xs:attribute default="0" name="cx" type="xs:float" use="optional" />
+        <xs:attribute default="0" name="cy" type="xs:float" use="optional" />
+        <xs:attribute default="0" name="cz" type="xs:float" use="optional" />
+        <xs:attribute default="0" name="ex" type="xs:float" use="optional" />
+        <xs:attribute default="0" name="ey" type="xs:float" use="optional" />
+        <xs:attribute default="0" name="ez" type="xs:float" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="BoundsField" substitutionGroup="engine:VisualElement" type="editor:BoundsFieldType" />
+  <xs:complexType name="RectIntFieldType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="true" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:attribute default="" name="binding-path" type="xs:string" use="optional" />
+        <xs:attribute default="" name="label" type="xs:string" use="optional" />
+        <xs:attribute default="0" name="x" type="xs:int" use="optional" />
+        <xs:attribute default="0" name="y" type="xs:int" use="optional" />
+        <xs:attribute default="0" name="w" type="xs:int" use="optional" />
+        <xs:attribute default="0" name="h" type="xs:int" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="RectIntField" substitutionGroup="engine:VisualElement" type="editor:RectIntFieldType" />
+  <xs:complexType name="Vector2IntFieldType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="true" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:attribute default="" name="binding-path" type="xs:string" use="optional" />
+        <xs:attribute default="" name="label" type="xs:string" use="optional" />
+        <xs:attribute default="0" name="x" type="xs:int" use="optional" />
+        <xs:attribute default="0" name="y" type="xs:int" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="Vector2IntField" substitutionGroup="engine:VisualElement" type="editor:Vector2IntFieldType" />
+  <xs:complexType name="Vector3IntFieldType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="true" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:attribute default="" name="binding-path" type="xs:string" use="optional" />
+        <xs:attribute default="" name="label" type="xs:string" use="optional" />
+        <xs:attribute default="0" name="x" type="xs:int" use="optional" />
+        <xs:attribute default="0" name="y" type="xs:int" use="optional" />
+        <xs:attribute default="0" name="z" type="xs:int" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="Vector3IntField" substitutionGroup="engine:VisualElement" type="editor:Vector3IntFieldType" />
+  <xs:complexType name="BoundsIntFieldType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="true" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:attribute default="" name="binding-path" type="xs:string" use="optional" />
+        <xs:attribute default="" name="label" type="xs:string" use="optional" />
+        <xs:attribute default="0" name="px" type="xs:int" use="optional" />
+        <xs:attribute default="0" name="py" type="xs:int" use="optional" />
+        <xs:attribute default="0" name="pz" type="xs:int" use="optional" />
+        <xs:attribute default="0" name="sx" type="xs:int" use="optional" />
+        <xs:attribute default="0" name="sy" type="xs:int" use="optional" />
+        <xs:attribute default="0" name="sz" type="xs:int" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="BoundsIntField" substitutionGroup="engine:VisualElement" type="editor:BoundsIntFieldType" />
+  <xs:complexType name="ProgressBarType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="false" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:attribute default="" name="binding-path" type="xs:string" use="optional" />
+        <xs:attribute default="0" name="low-value" type="xs:float" use="optional" />
+        <xs:attribute default="100" name="high-value" type="xs:float" use="optional" />
+        <xs:attribute default="" name="title" type="xs:string" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="ProgressBar" substitutionGroup="engine:VisualElement" type="editor:ProgressBarType" />
+</xs:schema>

+ 524 - 0
UIElementsSchema/UnityEngine.UIElements.xsd

@@ -0,0 +1,524 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xs:schema xmlns:editor="UnityEditor.UIElements" xmlns:engine="UnityEngine.UIElements" xmlns="UnityEditor.PackageManager.UI" elementFormDefault="qualified" targetNamespace="UnityEngine.UIElements" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+  <xs:complexType name="UXMLType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="xs:anyType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="UXML" type="engine:UXMLType" />
+  <xs:simpleType name="VisualElement_picking-mode_Type">
+    <xs:restriction base="xs:string">
+      <xs:enumeration value="Position" />
+      <xs:enumeration value="Ignore" />
+    </xs:restriction>
+  </xs:simpleType>
+  <xs:simpleType name="VisualElement_usage-hints_Type">
+    <xs:restriction base="xs:string">
+      <xs:enumeration value="None" />
+      <xs:enumeration value="DynamicTransform" />
+      <xs:enumeration value="GroupTransform" />
+    </xs:restriction>
+  </xs:simpleType>
+  <xs:complexType name="VisualElementType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="xs:anyType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="false" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="VisualElement" type="engine:VisualElementType" />
+  <xs:complexType name="IMGUIContainerType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="true" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="IMGUIContainer" substitutionGroup="engine:VisualElement" type="engine:IMGUIContainerType" />
+  <xs:complexType name="ImageType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="false" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="Image" substitutionGroup="engine:VisualElement" type="engine:ImageType" />
+  <xs:complexType name="LabelType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="false" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:attribute default="" name="binding-path" type="xs:string" use="optional" />
+        <xs:attribute default="" name="text" type="xs:string" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="Label" substitutionGroup="engine:VisualElement" type="engine:LabelType" />
+  <xs:complexType name="RepeatButtonType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="false" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:attribute default="" name="binding-path" type="xs:string" use="optional" />
+        <xs:attribute default="" name="text" type="xs:string" use="optional" />
+        <xs:attribute default="0" name="delay" type="xs:long" use="optional" />
+        <xs:attribute default="0" name="interval" type="xs:long" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="RepeatButton" substitutionGroup="engine:VisualElement" type="engine:RepeatButtonType" />
+  <xs:simpleType name="ScrollView_mode_Type">
+    <xs:restriction base="xs:string">
+      <xs:enumeration value="Vertical" />
+      <xs:enumeration value="Horizontal" />
+      <xs:enumeration value="VerticalAndHorizontal" />
+    </xs:restriction>
+  </xs:simpleType>
+  <xs:complexType name="ScrollViewType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="false" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:attribute default="Vertical" name="mode" type="engine:ScrollView_mode_Type" use="optional" />
+        <xs:attribute default="false" name="show-horizontal-scroller" type="xs:boolean" use="optional" />
+        <xs:attribute default="false" name="show-vertical-scroller" type="xs:boolean" use="optional" />
+        <xs:attribute default="20" name="horizontal-page-size" type="xs:float" use="optional" />
+        <xs:attribute default="20" name="vertical-page-size" type="xs:float" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="ScrollView" substitutionGroup="engine:VisualElement" type="engine:ScrollViewType" />
+  <xs:simpleType name="Scroller_direction_Type">
+    <xs:restriction base="xs:string">
+      <xs:enumeration value="Horizontal" />
+      <xs:enumeration value="Vertical" />
+    </xs:restriction>
+  </xs:simpleType>
+  <xs:complexType name="ScrollerType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="false" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:attribute default="0" name="low-value" type="xs:float" use="optional" />
+        <xs:attribute default="0" name="high-value" type="xs:float" use="optional" />
+        <xs:attribute default="Vertical" name="direction" type="engine:Scroller_direction_Type" use="optional" />
+        <xs:attribute default="0" name="value" type="xs:float" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="Scroller" substitutionGroup="engine:VisualElement" type="engine:ScrollerType" />
+  <xs:simpleType name="Slider_direction_Type">
+    <xs:restriction base="xs:string">
+      <xs:enumeration value="Horizontal" />
+      <xs:enumeration value="Vertical" />
+    </xs:restriction>
+  </xs:simpleType>
+  <xs:complexType name="SliderType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="true" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:attribute default="" name="binding-path" type="xs:string" use="optional" />
+        <xs:attribute default="" name="label" type="xs:string" use="optional" />
+        <xs:attribute default="0" name="value" type="xs:float" use="optional" />
+        <xs:attribute default="0" name="low-value" type="xs:float" use="optional" />
+        <xs:attribute default="10" name="high-value" type="xs:float" use="optional" />
+        <xs:attribute default="0" name="page-size" type="xs:float" use="optional" />
+        <xs:attribute default="Horizontal" name="direction" type="engine:Slider_direction_Type" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="Slider" substitutionGroup="engine:VisualElement" type="engine:SliderType" />
+  <xs:simpleType name="SliderInt_direction_Type">
+    <xs:restriction base="xs:string">
+      <xs:enumeration value="Horizontal" />
+      <xs:enumeration value="Vertical" />
+    </xs:restriction>
+  </xs:simpleType>
+  <xs:complexType name="SliderIntType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="true" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:attribute default="" name="binding-path" type="xs:string" use="optional" />
+        <xs:attribute default="" name="label" type="xs:string" use="optional" />
+        <xs:attribute default="0" name="value" type="xs:int" use="optional" />
+        <xs:attribute default="0" name="low-value" type="xs:int" use="optional" />
+        <xs:attribute default="10" name="high-value" type="xs:int" use="optional" />
+        <xs:attribute default="0" name="page-size" type="xs:int" use="optional" />
+        <xs:attribute default="Horizontal" name="direction" type="engine:SliderInt_direction_Type" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="SliderInt" substitutionGroup="engine:VisualElement" type="engine:SliderIntType" />
+  <xs:complexType name="MinMaxSliderType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="true" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:attribute default="" name="binding-path" type="xs:string" use="optional" />
+        <xs:attribute default="" name="label" type="xs:string" use="optional" />
+        <xs:attribute default="0" name="min-value" type="xs:float" use="optional" />
+        <xs:attribute default="10" name="max-value" type="xs:float" use="optional" />
+        <xs:attribute default="-3.402823E+38" name="low-limit" type="xs:float" use="optional" />
+        <xs:attribute default="3.402823E+38" name="high-limit" type="xs:float" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="MinMaxSlider" substitutionGroup="engine:VisualElement" type="engine:MinMaxSliderType" />
+  <xs:complexType name="ToggleType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="true" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:attribute default="" name="binding-path" type="xs:string" use="optional" />
+        <xs:attribute default="" name="label" type="xs:string" use="optional" />
+        <xs:attribute default="false" name="value" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="text" type="xs:string" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="Toggle" substitutionGroup="engine:VisualElement" type="engine:ToggleType" />
+  <xs:complexType name="TextFieldType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="true" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:attribute default="" name="binding-path" type="xs:string" use="optional" />
+        <xs:attribute default="" name="label" type="xs:string" use="optional" />
+        <xs:attribute default="" name="value" type="xs:string" use="optional" />
+        <xs:attribute default="-1" name="max-length" type="xs:int" use="optional" />
+        <xs:attribute default="false" name="password" type="xs:boolean" use="optional" />
+        <xs:attribute default="*" name="mask-character" type="xs:string" use="optional" />
+        <xs:attribute default="" name="text" type="xs:string" use="optional" />
+        <xs:attribute default="false" name="readonly" type="xs:boolean" use="optional" />
+        <xs:attribute default="false" name="multiline" type="xs:boolean" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="TextField" substitutionGroup="engine:VisualElement" type="engine:TextFieldType" />
+  <xs:complexType name="TemplateContainerType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="false" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:attribute default="" name="binding-path" type="xs:string" use="optional" />
+        <xs:attribute name="template" type="xs:string" use="required" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="TemplateContainer" substitutionGroup="engine:VisualElement" type="engine:TemplateContainerType" />
+  <xs:complexType name="BoxType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="false" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="Box" substitutionGroup="engine:VisualElement" type="engine:BoxType" />
+  <xs:complexType name="PopupWindowType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="false" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:attribute default="" name="binding-path" type="xs:string" use="optional" />
+        <xs:attribute default="" name="text" type="xs:string" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="PopupWindow" substitutionGroup="engine:VisualElement" type="engine:PopupWindowType" />
+  <xs:complexType name="ListViewType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="false" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:attribute default="30" name="item-height" type="xs:int" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="ListView" substitutionGroup="engine:VisualElement" type="engine:ListViewType" />
+  <xs:complexType name="TreeViewType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="false" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:attribute default="30" name="item-height" type="xs:int" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="TreeView" substitutionGroup="engine:VisualElement" type="engine:TreeViewType" />
+  <xs:complexType name="FoldoutType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="false" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:attribute default="" name="binding-path" type="xs:string" use="optional" />
+        <xs:attribute default="" name="text" type="xs:string" use="optional" />
+        <xs:attribute default="false" name="value" type="xs:boolean" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="Foldout" substitutionGroup="engine:VisualElement" type="engine:FoldoutType" />
+  <xs:complexType name="BindableElementType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="engine:VisualElement" />
+        </xs:sequence>
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="false" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:attribute default="" name="binding-path" type="xs:string" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="BindableElement" substitutionGroup="engine:VisualElement" type="engine:BindableElementType" />
+  <xs:complexType name="TextElementType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="false" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:attribute default="" name="binding-path" type="xs:string" use="optional" />
+        <xs:attribute default="" name="text" type="xs:string" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="TextElement" substitutionGroup="engine:VisualElement" type="engine:TextElementType" />
+  <xs:complexType name="ButtonType">
+    <xs:complexContent mixed="false">
+      <xs:restriction base="engine:VisualElementType">
+        <xs:attribute default="" name="name" type="xs:string" use="optional" />
+        <xs:attribute default="" name="view-data-key" type="xs:string" use="optional" />
+        <xs:attribute default="Position" name="picking-mode" type="engine:VisualElement_picking-mode_Type" use="optional" />
+        <xs:attribute default="" name="tooltip" type="xs:string" use="optional" />
+        <xs:attribute default="None" name="usage-hints" type="engine:VisualElement_usage-hints_Type" use="optional" />
+        <xs:attribute default="0" name="tabindex" type="xs:int" use="optional" />
+        <xs:attribute default="false" name="focusable" type="xs:boolean" use="optional" />
+        <xs:attribute default="" name="class" type="xs:string" use="optional" />
+        <xs:attribute default="" name="content-container" type="xs:string" use="optional" />
+        <xs:attribute default="" name="style" type="xs:string" use="optional" />
+        <xs:attribute default="" name="binding-path" type="xs:string" use="optional" />
+        <xs:attribute default="" name="text" type="xs:string" use="optional" />
+        <xs:anyAttribute processContents="lax" />
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+  <xs:element name="Button" substitutionGroup="engine:VisualElement" type="engine:ButtonType" />
+</xs:schema>

+ 33 - 0
dbFiles/Categories.php

@@ -0,0 +1,33 @@
+<?php
+/* Games.php */ 
+	$hostname = 'localhost';
+	$username = 'narKampen';
+	$pass = 'narKampenPassword';
+	$database = 'narKampen';
+	
+	$conn = new mysqli($hostname, $username, $pass, $database);
+	if (!$conn) {
+		die("Connection Failed. ". mysqli_connect_error());
+	}
+	mysqli_set_charset($conn,'utf8');
+		
+	$sql = "SELECT id, name, r, g, b ,a FROM category";
+	$result = $conn->query($sql);
+	
+	if ($result->num_rows > 0) {
+		$returnArray = array();
+		$i = 0;
+		while ($data = $result->fetch_assoc()) {
+			foreach ($data as $key => $value) {
+				$returnArray[$i][$key] = $value;
+			}
+			$i++;
+		}
+		echo json_encode($returnArray);
+		
+	} else {
+		echo "ERROR - No Categories found";
+	}
+	$conn->close();
+	
+?>

+ 3 - 1
dbFiles/Games.php

@@ -11,7 +11,9 @@
 	}
 	mysqli_set_charset($conn,'utf8');
 	
-	$userId = $conn->real_escape_string($_GET['userId']);
+	$callFunction = $conn->real_escape_string($_POST['f']);
+	$userId = $conn->real_escape_string($_POST['userId']);
+	
 		
 	$sql = "SELECT * FROM games WHERE userId = $userId";
 	$result = $conn->query($sql);

+ 93 - 6
dbFiles/OnlineGames.php

@@ -19,8 +19,7 @@
 	if ($callFunction === "list"){	
 		$sql = "SELECT * FROM game WHERE id IN (SELECT gameId FROM gamePlayers WHERE playerId = $userId)";
 		$result = $conn->query($sql);
-		
-		
+
 		if ($result->num_rows > 0) {
 			$returnArray = array();
 			$i = 0;
@@ -41,10 +40,10 @@
 		if (!$result) {
 			echo "UPDATE player status failed " . $conn->error;
 		} else {
-			$sql = "SELECT count(*) FROM gamePlayers WHERE gameId = $gameId AND status NOT LIKE 'DECLINED'";
+			$sql = "SELECT count(*) as c FROM gamePlayers WHERE gameId = $gameId AND status NOT LIKE 'DECLINED'";
 			$result = $conn->query($sql);
 			while ($data = $result->fetch_assoc()) {
-				if ($data[0] == 1) { // Alla utom den som startade spelet har nekat, sätt status till declined på game
+				if ($data['c'] == 1) { // Alla utom den som startade spelet har nekat, sätt status till declined på game
 					$sql = "UPDATE game SET status = 'DECLINED' WHERE id = $gameId";
 					$result = $conn->query($sql);
 					if (!$result) {
@@ -61,21 +60,109 @@
 		} else {
 			$sql = "SELECT * FROM gamePlayers WHERE gameId = $gameId";
 			$result = $conn->query($sql);
+			$done = true;
 			while ($data = $result->fetch_assoc()) {
-				$done = true;
 				if ($data['status'] != "ACCEPTED") {
+					echo $data['status'];
 					$done = false;
 				}
 			}
 			if ($done) {
-				$sql = "UPDATE game SET status = 'ACTIVE'";
+				$sql = "UPDATE game SET status = 'ACTIVE' WHERE id = $gameId";
 				$result = $conn->query($sql);
 				if (!$result) {
 					echo "updating game status active failed " . $conn->error;
 				}
 			}
 		}
+	} else if ($callFunction === "SetLastPlayed") {
+		$sql = "UPDATE game SET lastPlayedDate = NOW() WHERE id = $gameId";
+		$result = $conn->query($sql);
+		if (!$result) {
+			echo "Updating lastPlayedDate failed " . $conn->error; 
+		}
+	} else if ($callFunction === "SetQuestionsLost") {
+		$questionsLost = $_POST['questionsLost'];
+		$sql = "UPDATE gamePlayers SET questionsLost = $questionsLost WHERE gameId = $gameId AND playerId = (SELECT id from users WHERE name = '$userName')";
+		$result = $conn->query($sql);
+		if (!$result) {
+			echo "Updating questionsLost resulted in error: " . $conn->error;
+		}
+	} else if ($callFunction === "DeleteGame") {
+		$sql = "DELETE FROM game WHERE id = $gameId";
+		$result = $conn->query($sql);
+		if (!$result) {
+			echo "Failed to delete game with id $gameId - error: " . $conn->error;
+		}
+		
+		$sql = "DELETE FROM gamePlayers WHERE gameId = $gameId";
+		$result = $conn->query($sql);
+		if (!$result) {
+			echo "Failed to delete gamePlayers with id $gameId - error: " . $conn->error;
+		}	
+	} else if ($callFunction === "CurrentPlayer") {
+		$sql = "SELECT currentPlayer FROM game WHERE gameId = $gameId";
+		$result = $conn->query($sql);
+		if (!$result) {
+			echo "Failed to delete game with id $gameId - error: " . $conn->error;
+		} else {
+			if ($result->num_rows > 0) {
+				$returnArray = array();
+				$i = 0;
+				while ($data = $result->fetch_assoc()) {
+					$currentPlayer = $data['currentPlayer'];
+				}
+				echo $currentPlayer;
+			}
+		}
+		
+	} else if ($callFunction === "SetCurrentPlayer") {
+		$currentPlayer = $_POST['currentPlayer'];
+		$sql = "UPDATE game SET currentPlayer = '$currentPlayer' WHERE id = $gameId";
+		$result = $conn->query($sql);
+		if (!$result) {
+			echo "Failed to update current player for game with id $gameId - error: " . $conn->error;
+		}
+	} else if ($callFunction === "GetPlayerPoints") {
+		$sql = "SELECT userLockedQuestions FROM game WHERE gameId = $gameId AND playerId = (SELECT id FROM users WHERE name = '$userName')";
+		$result = $conn->query($sql);
+		$data = $result->fetch_assoc();
+		
+		return $data['userLockedQuestions'];
+	} else if ($callFunction === "SetFinishedDate") {
+		$finishedDate = $_POST['finishedDate'];
+		$sql = "UPDATE game SET finishedDate = '$finishedDate' WHERE id = $gameId";
+		$result = $conn->query($sql);
+		if (!$result) {
+			echo "Failed to update current player for game with id $gameId - error: " . $conn->error;
+		}
+	} else if ($callFunction === "SetRound") {
+		$round = $_POST['round'];
+		$sql = "UPDATE game SET round = '$round' WHERE id = $gameId";
+		$result = $conn->query($sql);
+		if (!$result) {
+			echo "Failed to update current player for game with id $gameId - error: " . $conn->error;
+		}
+	} else if ($callFunction === "GetRound") {
+		$sql = "SELECT round FROM game WHERE gameId = $gameId";
+		$result = $conn->query($sql);
+		$data = $result->fetch_assoc();
+		
+		return $data['round'];
+	} else if ($callFunction === "GetPlayers") {
+		$sql = "SELECT username, userLockedQuestions FROM gamePlayers INNER JOIN users ON users.id = gamePlayers.playerId WHERE gameId = $gameId";
+		$returnArray = array();
+		$i = 0;
+		while ($data = $result->fetch_assoc()) {
+			foreach ($data as $key => $value) {
+				$returnArray[$i][$key] = $value;
+			}
+			$i++;
+		}
+		echo json_encode($returnArray);
 	}
+	
+	
 	$conn->close();
 	
 ?>

Неке датотеке нису приказане због велике количине промена