public override void OnNodeGUI() { EditorGUILayout.LabelField("Biome: " + outputBiome.name); EditorGUILayout.BeginHorizontal(); { EditorGUIUtility.labelWidth = 40; EditorGUILayout.LabelField("id: " + outputBiome.id); EditorGUIUtility.labelWidth = 0; Rect colorRect = EditorGUILayout.GetControlRect(false, EditorGUIUtility.singleLineHeight, GUILayout.ExpandWidth(true)); if (e.type == EventType.Repaint) { biomeColorPreviewRect = colorRect; } EditorGUI.BeginDisabledGroup(false); EditorGUIUtility.DrawColorSwatch(biomeColorPreviewRect, outputBiome.previewColor); EditorGUI.EndDisabledGroup(); } EditorGUILayout.EndHorizontal(); EditorGUILayout.LabelField("Biome Graph reference"); EditorGUI.BeginChangeCheck(); biomeGraph = EditorGUILayout.ObjectField(biomeGraph, typeof(PWBiomeGraph), false) as PWBiomeGraph; if (EditorGUI.EndChangeCheck()) { NotifyReload(); } if (biomeGraph != null) { if (GUILayout.Button("Open " + biomeGraph.name)) { AssetDatabase.OpenAsset(biomeGraph); } } }
public PWBiomePresetScreen(PWBiomeGraph biomeGraph) { this.biomeGraph = biomeGraph; plainTexture = Resources.Load <Texture2D>(""); mountainTexture = Resources.Load <Texture2D>(""); mesaTexture = Resources.Load <Texture2D>(""); swamplandTexture = Resources.Load <Texture2D>(""); PresetCellList presets = new PresetCellList() { { "Earth-like", plainTexture, "Plains / Prairies", BuildPlain }, { "Earth-like", mountainTexture, "Mountains", BuildMountains }, { "Earth-like", mesaTexture, "Mesas", BuildMesa }, { "Earth-like", swamplandTexture, "Swamplands", BuildSwampland }, }; LoadPresetList(presets); }