public static void ResetContents()
        {
            OnlineTemplateManager window = GetWindow <OnlineTemplateManager>();

            window.Close();
            _known_templates   = new Dictionary <string, templateInfo>();
            _selected_template = new templateInfo();
        }
        private static void BuildAndUploadTemplate()
        {
            EditorApplication.update -= BuildAndUploadTemplate;

            List <BuildTarget> targets            = SettingsManager.SelectedBuildTargets;
            string             item_type_singular = "space_template";
            string             itemRootName       = templateScene.ToLower();
            string             item_id            = _selected_template.template_data.space_template_id;

            LoginManager.BuildAndUploadAltVRItem(targets, item_type_singular, itemRootName, item_id);

            // Reload kit data (and update display)
            LoadSingleTemplate(item_id);
            _selected_template = _known_templates[item_id];

            LoginManager window = GetWindow <LoginManager>();

            window.ShowNotification(new GUIContent("Template upload finished"), 5.0f);
        }
        public void OnGUI()
        {
            GUILayout.BeginVertical(new GUIStyle {
                padding = new RectOffset(10, 10, 10, 10)
            });

            if (HasLoadedTemplates)
            {
                m_scrollPosition = GUILayout.BeginScrollView(m_scrollPosition);
                foreach (var tmpl in _known_templates)
                {
                    EditorGUILayout.BeginHorizontal(GUILayout.Width(120.0f));

                    EditorGUILayout.LabelField(tmpl.Value.template_data.activity_name);
                    GUILayout.FlexibleSpace();
                    if (GUILayout.Button("Select", EditorStyles.miniButton))
                    {
                        _selected_template = _known_templates[tmpl.Value.template_data.space_template_id];
                        this.Close();
                        GetWindow <LoginManager>().Repaint();
                    }

                    EditorGUILayout.EndHorizontal();
                }

                GUILayout.EndScrollView();
            }
            else
            {
                GUILayout.Label(
                    "No templates loaded.\n" +
                    "Either press \"Load templates\"\n" +
                    "to load known templates from the account,\n" +
                    "Or press \"Create New Template\"\n" +
                    "to create a new one.", new GUIStyle()
                {
                    fontStyle = FontStyle.Bold
                });
            }

            if (GUILayout.Button("Load Templates"))
            {
                LoadTemplates();
            }

            if (GUILayout.Button("Create New Template"))
            {
                CreateTemplateWindow window = CreateInstance <CreateTemplateWindow>();
                window.ShowModalUtility();
                if (window.rc)
                {
                    string tmpl_id = CreateTemplate(window.templateName, window.description, window.imageFile, window.tag_list);
                    if (LoadSingleTemplate(tmpl_id))
                    {
                        _selected_template = _known_templates[tmpl_id];
                    }
                }
            }
            // CreateKit("__AUUTest", "This is a test for the AUU kit creation", "D:/Users/carsten/Pictures/Sweet-Fullscene.png");
            GUILayout.EndVertical();
        }