Exemplo n.º 1
0
        private static void TagsDialog(SimulatedVRCPlayer player)
        {
            Dictionary <string, string> tags = player.GetRawTags();

            if (tags.Count > 0)
            {
                SimpleGUI.IndentWithHeader(
                    () => GUILayout.Label("Tags: "),
                    () =>
                {
                    foreach (string key in new List <string>(tags.Keys))
                    {
                        GUILayout.BeginHorizontal();
                        tags[key] = EditorGUILayout.TextField(key, tags[key]);
                        SimpleGUI.ActionButton("X", () => tags.Remove(key), GUILayout.MaxWidth(30));
                        GUILayout.EndHorizontal();
                    }
                }
                    );
            }

            GUILayout.BeginHorizontal();
            string tagName  = player.SetMetadata <string>("tagName", oldName => EditorGUILayout.TextField(oldName));
            string tagValue = player.SetMetadata <string>("tagValue", oldName => EditorGUILayout.TextField(oldName));

            SimpleGUI.ActionButton("Add tag", () => tags[tagName] = tagValue);
            GUILayout.EndHorizontal();
        }