protected override void Draw() { if (GUILayout.Button("Add")) { CreateAppWindow.ShowWindow(); } appsScroll = EditorGUILayout.BeginScrollView(appsScroll); if (apps != null) { foreach (var app in apps) { EditorGUILayout.BeginHorizontal(GUI.skin.box); if (app.thumbnail == null) { GUILayout.Box(Texture2D.whiteTexture, GUILayout.Width(50), GUILayout.Height(50)); } else { GUILayout.Box(app.thumbnail, GUILayout.Width(50), GUILayout.Height(50)); } EditorGUILayout.BeginVertical(); EditorGUILayout.LabelField(app.name); GUILayout.Space(5); EditorGUILayout.LabelField(app.name); EditorGUILayout.EndVertical(); EditorGUILayout.EndHorizontal(); } } EditorGUILayout.EndScrollView(); }
public static void ShowWindow() { var win = new CreateAppWindow(); win.title = "CreateApp"; win.maxSize = win.minSize = new Vector2(300, 70); var position = win.position; position.center = new Rect(0f, 0f, Screen.currentResolution.width, Screen.currentResolution.height).center; win.position = position; win.Show(); }