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(); }