void SceneContentGUI() { using (new GUILayout.HorizontalScope()) { using (new GUILayout.VerticalScope()) { listScroll = GUILayout.BeginScrollView(listScroll, GUI.skin.box, GUILayout.Width(discoverAsset.DiscoverListWidth)); using (new GUILayout.VerticalScope(GUILayout.ExpandHeight(true))) { foreach (var category in discoverObjects.Keys.OrderBy((x) => x.ToString())) { if (!string.IsNullOrEmpty(category)) { GUILayout.Label(category, EditorStyles.boldLabel); } foreach (var item in discoverObjects[category]) { EditorGUI.BeginChangeCheck(); bool value = GUILayout.Toggle(item == selectedDiscover, item.Name, Styles.listItem); if (value) { // Select the new one if not selected if (selectedDiscover != item) { if (EditorGUI.EndChangeCheck()) { if (discoverAsset.Debug) { Selection.activeObject = item; } SetSelectedDiscover(item); } } Rect r = GUILayoutUtility.GetLastRect(); int c = EditorGUIUtility.isProSkin ? 1 : 0; EditorGUI.DrawRect(r, new Color(c, c, c, 0.1f)); } } } GUILayout.FlexibleSpace(); } GUILayout.EndScrollView(); } GUILayout.Space(4); using (new GUILayout.VerticalScope(GUILayout.Width(440))) { contentScroll = GUILayout.BeginScrollView(contentScroll); GUILayout.Space(8); DiscoverEditor.DrawDiscoverContentGUI(selectedDiscover); GUILayout.FlexibleSpace(); GUILayout.EndScrollView(); } } }
void GlobalContentGUI() { globalContentScroll = GUILayout.BeginScrollView(globalContentScroll); using (new GUILayout.VerticalScope(Styles.indent)) { GUILayout.Label(discoverAsset.Title, Styles.header); using (new GUILayout.VerticalScope(Styles.indent)) { if (discoverAsset.Image != null) { DiscoverEditor.DrawImage(discoverAsset.Image); } GUILayout.Label(discoverAsset.Description, Styles.body); if (discoverAsset.Scenes != null) { foreach (var map in discoverAsset.Scenes) { using (new GroupLabelScope(map.Title)) { if (map.Image != null) { DiscoverEditor.DrawImage(map.Image); } GUILayout.Label(map.Description, Styles.body); using (new GUILayout.HorizontalScope()) { GUILayout.FlexibleSpace(); if (map.SceneSetups != null) { foreach (var sceneSetup in map.SceneSetups) { if (sceneSetup != null && GUILayout.Button($"Open {sceneSetup.name}")) { LoadSceneSetup(sceneSetup); } } } if (map.SingleScenes != null) { foreach (var singleScene in map.SingleScenes) { if (singleScene != null && GUILayout.Button($"Open {singleScene.name}")) { LoadSingleScene(singleScene); } } } } } } } } } GUILayout.FlexibleSpace(); GUILayout.EndScrollView(); }