private void OnGroupAssetGUI() { if (target == null) { FocusOn(null, SelectionType.Map); return; } MapGroupAsset groupAsset = target as MapGroupAsset; DrawPreview(); GUILayout.Label(groupAsset.groupName, Prefs.nameStyle); groupAsset.information = EditorGUILayout.TextArea(groupAsset.information, Prefs.informationStyle); if (GUILayout.Button("", Prefs.mapAssetBackgroundStyle, GUILayout.ExpandHeight(true))) { GUI.FocusControl(""); } GUILayout.BeginHorizontal(Prefs.mapAssetBackgroundStyle, GUILayout.Height(28)); { GUILayout.FlexibleSpace(); if (!groupAsset.baked && GUILayout.Button("烘焙", GUILayout.Width(60))) { MapGroupAssetEditor.BakeGroupAsset(groupAsset); } if (GUILayout.Button("加载组", GUILayout.Width(60))) { MapGroupAssetEditor.LoadGroup(MapAssetManager.CurrentAsset, MapSystem.currentGroupIndex); FocusOn(MapSystem.groupList[MapSystem.currentGroupIndex], SelectionType.Group); } } GUILayout.EndHorizontal(); }
private void OnGroupGUI() { MapGroup group = target as MapGroup; DrawPreview(true); if (group == null) { GUILayout.Label("当前组为空", Prefs.informationStyle); if (GUILayout.Button("", Prefs.mapAssetBackgroundStyle, GUILayout.ExpandHeight(true))) { GUI.FocusControl(""); } GUILayout.BeginHorizontal(Prefs.mapAssetBackgroundStyle, GUILayout.Height(28)); { GUILayout.FlexibleSpace(); if (GUILayout.Button("新建组", GUILayout.Width(60))) { MapGroupAssetEditor.NewEmptyGroup(MapSystem.currentGroupIndex); FocusOn(MapSystem.groupList[MapSystem.currentGroupIndex], SelectionType.Group); } if (MapAssetManager.CurrentAsset != null && GUILayout.Button("加载组", GUILayout.Width(60))) { MapGroupAssetEditor.LoadGroup(MapAssetManager.CurrentAsset, MapSystem.currentGroupIndex); FocusOn(MapSystem.groupList[MapSystem.currentGroupIndex], SelectionType.Group); } } GUILayout.EndHorizontal(); } else { EditableNameField(group); if (GUILayout.Button("组序号:" + group.index, Prefs.mapAssetBackgroundStyle, GUILayout.ExpandHeight(true))) { GUI.FocusControl(""); } GUILayout.BeginHorizontal(Prefs.mapAssetBackgroundStyle, GUILayout.Height(28)); { GUILayout.FlexibleSpace(); if (GUILayout.Button("保存组", GUILayout.Width(60))) { MapGroupAssetEditor.SaveGroup(group); FocusOn(MapSystem.groupList[MapSystem.currentGroupIndex], SelectionType.Group); } if (GUILayout.Button("卸载组", GUILayout.Width(60))) { FocusOn(null, SelectionType.Group); MapGroupAssetEditor.UnLoadGroup(group); } if (MapAssetManager.CurrentAsset != null && GUILayout.Button("加载组", GUILayout.Width(60))) { MapGroupAssetEditor.LoadGroup(MapAssetManager.CurrentAsset, MapSystem.currentGroupIndex); FocusOn(MapSystem.groupList[MapSystem.currentGroupIndex], SelectionType.Group); } } GUILayout.EndHorizontal(); } }