2024-03-05 17:34:41 +08:00
#if GRIFFIN
using UnityEngine ;
2023-12-30 17:37:48 +08:00
using System.Collections ;
using System.Collections.Generic ;
using UnityEditor ;
using Pinwheel.Griffin ;
using Pinwheel.Griffin.PaintTool ;
using Pinwheel.Griffin.SplineTool ;
using Pinwheel.Griffin.StampTool ;
using Pinwheel.Griffin.GroupTool ;
2024-03-05 17:34:41 +08:00
using Pinwheel.Griffin.ErosionTool ;
2023-12-30 17:37:48 +08:00
namespace Pinwheel.Griffin.Wizard
{
public static class GCreateLevelTabDrawer
{
internal static Vector2 scrollPos ;
internal static MenuCommand menuCmd ;
2024-03-05 17:34:41 +08:00
private class GBaseGUI
{
public static readonly GUIContent INSTRUCTION = new GUIContent ( "Follow the steps below to create your level. Hover on labels for instruction." ) ;
}
2023-12-30 17:37:48 +08:00
internal static void Draw ( )
{
2024-03-05 17:34:41 +08:00
EditorGUILayout . LabelField ( GBaseGUI . INSTRUCTION , GEditorCommon . BoldLabel ) ;
2023-12-30 17:37:48 +08:00
scrollPos = EditorGUILayout . BeginScrollView ( scrollPos ) ;
if ( GCommon . CurrentRenderPipeline = = GRenderPipelineType . Universal )
{
DrawRenderPipelineSettingGUI ( ) ;
}
DrawCreateTerrainsGUI ( ) ;
DrawTerrainsManagementGUI ( ) ;
DrawSculptingGUI ( ) ;
DrawTexturingGUI ( ) ;
DrawVertexColorTexturingGUI ( ) ;
2024-03-05 17:34:41 +08:00
DrawSimulationGUI ( ) ;
2023-12-30 17:37:48 +08:00
DrawFoliageAndObjectSpawningGUI ( ) ;
DrawCreateSplineGUI ( ) ;
2024-03-05 17:34:41 +08:00
DrawWaterSkyGUI ( ) ;
2023-12-30 17:37:48 +08:00
DrawUtilitiesGUI ( ) ;
EditorGUILayout . EndScrollView ( ) ;
}
2024-03-05 17:34:41 +08:00
private class GRenderPipelineGUI
2023-12-30 17:37:48 +08:00
{
2024-03-05 17:34:41 +08:00
public static readonly string LABEL = "0. Universal Render Pipeline Setup" ;
public static readonly string ID = "wizard-rp-setup" ;
public static readonly GUIContent INSTRUCTION = new GUIContent ( "Install additional package for Universal Render Pipeline" ) ;
public static readonly GUIContent STATUS_INSTALLED = new GUIContent ( "Status: INSTALLED" ) ;
public static readonly GUIContent STATUS_NOT_INSTALLED = new GUIContent ( "Status: NOT INSTALLED" ) ;
public static readonly GUIContent INSTALL_BTN = new GUIContent ( "Install" ) ;
}
2023-12-30 17:37:48 +08:00
2024-03-05 17:34:41 +08:00
private static void DrawRenderPipelineSettingGUI ( )
{
GEditorCommon . Foldout ( GRenderPipelineGUI . LABEL , true , GRenderPipelineGUI . ID , ( ) = >
2023-12-30 17:37:48 +08:00
{
2024-03-05 17:34:41 +08:00
EditorGUILayout . LabelField ( GRenderPipelineGUI . INSTRUCTION , GEditorCommon . WordWrapLeftLabel ) ;
EditorGUILayout . LabelField ( GPackageInitializer . isUrpSupportInstalled ? GRenderPipelineGUI . STATUS_INSTALLED : GRenderPipelineGUI . STATUS_NOT_INSTALLED , GEditorCommon . WordWrapLeftLabel ) ;
if ( GCommon . CurrentRenderPipeline = = GRenderPipelineType . Universal )
2023-12-30 17:37:48 +08:00
{
2024-03-05 17:34:41 +08:00
if ( GUILayout . Button ( GRenderPipelineGUI . INSTALL_BTN ) )
2023-12-30 17:37:48 +08:00
{
GUrpPackageImporter . Import ( ) ;
#if GRIFFIN_URP
Griffin . URP . GGriffinUrpInstaller . Install ( ) ;
#endif
}
}
} ) ;
}
2024-03-05 17:34:41 +08:00
private class GCreateTerrainGUI
2023-12-30 17:37:48 +08:00
{
2024-03-05 17:34:41 +08:00
public static readonly string LABEL = "1. Create Terrains" ;
public static readonly string ID = "wizard-create-terrains" ;
2023-12-30 17:37:48 +08:00
2024-03-05 17:34:41 +08:00
public static readonly string PHYSICAL_HEADER = "Physical" ;
public static readonly GUIContent ORIGIN = new GUIContent ( "Origin" , "Position of the first terrain in the grid." ) ;
public static readonly GUIContent TILE_SIZE = new GUIContent ( "Tile Size" , "Size of each terrain tile in world space." ) ;
public static readonly GUIContent TILE_X = new GUIContent ( "Tile Count X" , "Number of tiles along X-axis." ) ;
public static readonly GUIContent TILE_Z = new GUIContent ( "Tile Count Z" , "Number of tiles along Z-axis." ) ;
public static readonly GUIContent WORLD_SIZE = new GUIContent ( "World Size" , "Size of the terrain grid in world space." ) ;
public static readonly string MATERIAL_HEADER = "Material" ;
public static readonly string UTILITIES_HEADER = "Utilities" ;
public static readonly GUIContent NAME_PREFIX = new GUIContent ( "Name Prefix" , "The beginning of each terrain's name. Useful for some level streaming system." ) ;
public static readonly GUIContent GROUP_ID = new GUIContent ( "Group Id" , "An integer for grouping and connecting adjacent terrain tiles." ) ;
public static readonly string DATA_HEADER = "Data" ;
public static readonly GUIContent DIRECTORY = new GUIContent ( "Directory" , "Where to store created terrain data. A sub-folder of Assets/ is recommended." ) ;
public static readonly GUIContent CREATE_BTN = new GUIContent ( "Create" ) ;
}
private static void DrawCreateTerrainsGUI ( )
{
GEditorCommon . Foldout ( GCreateTerrainGUI . LABEL , true , GCreateTerrainGUI . ID , ( ) = >
2023-12-30 17:37:48 +08:00
{
GEditorSettings . WizardToolsSettings settings = GEditorSettings . Instance . wizardTools ;
2024-03-05 17:34:41 +08:00
GEditorCommon . Header ( GCreateTerrainGUI . PHYSICAL_HEADER ) ;
settings . origin = GEditorCommon . InlineVector3Field ( GCreateTerrainGUI . ORIGIN , settings . origin ) ;
2023-12-30 17:37:48 +08:00
2024-03-05 17:34:41 +08:00
settings . tileSize = GEditorCommon . InlineVector3Field ( GCreateTerrainGUI . TILE_SIZE , settings . tileSize ) ;
2023-12-30 17:37:48 +08:00
settings . tileSize = new Vector3 (
Mathf . Max ( 1 , settings . tileSize . x ) ,
Mathf . Max ( 1 , settings . tileSize . y ) ,
Mathf . Max ( 1 , settings . tileSize . z ) ) ;
2024-03-05 17:34:41 +08:00
settings . tileCountX = EditorGUILayout . IntField ( GCreateTerrainGUI . TILE_X , settings . tileCountX ) ;
2023-12-30 17:37:48 +08:00
settings . tileCountX = Mathf . Max ( 1 , settings . tileCountX ) ;
2024-03-05 17:34:41 +08:00
settings . tileCountZ = EditorGUILayout . IntField ( GCreateTerrainGUI . TILE_Z , settings . tileCountZ ) ;
2023-12-30 17:37:48 +08:00
settings . tileCountZ = Mathf . Max ( 1 , settings . tileCountZ ) ;
2024-03-05 17:34:41 +08:00
float worldSizeX = settings . tileCountX * settings . tileSize . x ;
float worldSizeY = settings . tileSize . y ;
float worldSizeZ = settings . tileCountZ * settings . tileSize . z ;
GUIContent worldSizeContent = new GUIContent ( $"{worldSizeX}m x {worldSizeY}m x {worldSizeZ}m" ) ;
EditorGUILayout . LabelField ( GCreateTerrainGUI . WORLD_SIZE , worldSizeContent ) ;
2023-12-30 17:37:48 +08:00
2024-03-05 17:34:41 +08:00
GEditorCommon . Header ( GCreateTerrainGUI . MATERIAL_HEADER ) ;
GWizardEditorCommon . DrawMaterialSettingsGUI ( ) ;
2023-12-30 17:37:48 +08:00
2024-03-05 17:34:41 +08:00
GEditorCommon . Header ( GCreateTerrainGUI . UTILITIES_HEADER ) ;
settings . terrainNamePrefix = EditorGUILayout . TextField ( GCreateTerrainGUI . NAME_PREFIX , settings . terrainNamePrefix ) ;
2023-12-30 17:37:48 +08:00
2024-03-05 17:34:41 +08:00
settings . groupId = EditorGUILayout . IntField ( GCreateTerrainGUI . NAME_PREFIX , settings . groupId ) ;
2023-12-30 17:37:48 +08:00
2024-03-05 17:34:41 +08:00
GEditorCommon . Header ( GCreateTerrainGUI . DATA_HEADER ) ;
2023-12-30 17:37:48 +08:00
string dir = settings . dataDirectory ;
2024-03-05 17:34:41 +08:00
GEditorCommon . BrowseFolder ( GCreateTerrainGUI . DIRECTORY , ref dir ) ;
2023-12-30 17:37:48 +08:00
if ( string . IsNullOrEmpty ( dir ) )
{
dir = "Assets/" ;
}
settings . dataDirectory = dir ;
2024-03-05 17:34:41 +08:00
if ( GUILayout . Button ( GCreateTerrainGUI . CREATE_BTN ) )
2023-12-30 17:37:48 +08:00
{
GameObject environmentRoot = null ;
if ( menuCmd ! = null & & menuCmd . context ! = null )
{
environmentRoot = menuCmd . context as GameObject ;
}
if ( environmentRoot = = null )
{
environmentRoot = new GameObject ( "Low Poly Environment" ) ;
environmentRoot . transform . position = settings . origin ;
}
GWizard . CreateTerrains ( environmentRoot ) ;
}
} ) ;
}
2024-03-05 17:34:41 +08:00
private class GTerrainManagementGUI
2023-12-30 17:37:48 +08:00
{
2024-03-05 17:34:41 +08:00
public static readonly string LABEL = "2. Terrains Management" ;
public static readonly string ID = "wizard-terrains-management" ;
public static readonly string INSTRUCTION_1 = "Edit properties of an individual terrain by selecting it and use the Inspector." ;
public static readonly string INSTRUCTION_2 = string . Format ( "Use context menus ({0}) in the terrain Inspector to perform additional tasks." , GEditorCommon . contextIconText ) ;
public static readonly string INSTRUCTION_3 = "Use the Group Tool to edit properties of multiple terrains at once." ;
public static readonly GUIContent CREATE_BTN = new GUIContent ( "Create Group Tool" ) ;
}
2023-12-30 17:37:48 +08:00
2024-03-05 17:34:41 +08:00
private static void DrawTerrainsManagementGUI ( )
{
GEditorCommon . Foldout ( GTerrainManagementGUI . LABEL , false , GTerrainManagementGUI . ID , ( ) = >
2023-12-30 17:37:48 +08:00
{
EditorGUILayout . LabelField (
2024-03-05 17:34:41 +08:00
GTerrainManagementGUI . INSTRUCTION_1 ,
2023-12-30 17:37:48 +08:00
GEditorCommon . WordWrapLeftLabel ) ;
EditorGUILayout . LabelField (
2024-03-05 17:34:41 +08:00
GTerrainManagementGUI . INSTRUCTION_2 ,
2023-12-30 17:37:48 +08:00
GEditorCommon . WordWrapLeftLabel ) ;
EditorGUILayout . LabelField (
2024-03-05 17:34:41 +08:00
GTerrainManagementGUI . INSTRUCTION_3 ,
2023-12-30 17:37:48 +08:00
GEditorCommon . WordWrapLeftLabel ) ;
2024-03-05 17:34:41 +08:00
if ( GUILayout . Button ( GTerrainManagementGUI . CREATE_BTN ) )
2023-12-30 17:37:48 +08:00
{
GTerrainGroup group = GWizard . CreateGroupTool ( ) ;
EditorGUIUtility . PingObject ( group ) ;
Selection . activeGameObject = group . gameObject ;
}
} ) ;
}
2024-03-05 17:34:41 +08:00
private class GSculptingGUI
2023-12-30 17:37:48 +08:00
{
2024-03-05 17:34:41 +08:00
public static readonly string LABEL = "3. Sculpting" ;
public static readonly string ID = "wizard-sculpting" ;
public static readonly GUIContent SELECT_WORKFLOW = new GUIContent ( "Select the workflow you prefer." ) ;
public static readonly string PAINTING_HEADER = "Painting" ;
public static readonly GUIContent PAINTING_INSTRUCTION = new GUIContent ( "Use a set of painters for hand sculpting terrain shape." ) ;
public static readonly GUIContent CREATE_PAINTER_BTN = new GUIContent ( "Create Geometry - Texture Painter" ) ;
public static readonly string STAMPING_HEADER = "Stamping" ;
public static readonly GUIContent STAMPING_INSTRUCTION = new GUIContent ( "Use grayscale textures to stamp mountains, plateaus, rivers, etc. and blend using some math operations." ) ;
public static readonly GUIContent CREATE_STAMPER_BTN = new GUIContent ( "Create Geometry Stamper" ) ;
}
2023-12-30 17:37:48 +08:00
2024-03-05 17:34:41 +08:00
private static void DrawSculptingGUI ( )
{
GEditorCommon . Foldout ( GSculptingGUI . LABEL , false , GSculptingGUI . ID , ( ) = >
2023-12-30 17:37:48 +08:00
{
2024-03-05 17:34:41 +08:00
EditorGUILayout . LabelField ( GSculptingGUI . SELECT_WORKFLOW , GEditorCommon . WordWrapLeftLabel ) ;
2023-12-30 17:37:48 +08:00
2024-03-05 17:34:41 +08:00
GEditorCommon . Header ( GSculptingGUI . PAINTING_HEADER ) ;
EditorGUILayout . LabelField ( GSculptingGUI . PAINTING_INSTRUCTION , GEditorCommon . WordWrapLeftLabel ) ;
if ( GUILayout . Button ( GSculptingGUI . CREATE_PAINTER_BTN ) )
2023-12-30 17:37:48 +08:00
{
GTerrainTexturePainter painter = GWizard . CreateGeometryTexturePainter ( ) ;
EditorGUIUtility . PingObject ( painter . gameObject ) ;
Selection . activeGameObject = painter . gameObject ;
}
2024-03-05 17:34:41 +08:00
GEditorCommon . Header ( GSculptingGUI . STAMPING_HEADER ) ;
EditorGUILayout . LabelField ( GSculptingGUI . STAMPING_INSTRUCTION , GEditorCommon . WordWrapLeftLabel ) ;
if ( GUILayout . Button ( GSculptingGUI . CREATE_STAMPER_BTN ) )
2023-12-30 17:37:48 +08:00
{
GGeometryStamper stamper = GWizard . CreateGeometryStamper ( ) ;
EditorGUIUtility . PingObject ( stamper . gameObject ) ;
Selection . activeGameObject = stamper . gameObject ;
}
} ) ;
}
2024-03-05 17:34:41 +08:00
private class GTexturingGUI
2023-12-30 17:37:48 +08:00
{
2024-03-05 17:34:41 +08:00
public static readonly string LABEL = "4. Texturing" ;
public static readonly string ID = "wizard-texturing" ;
public static readonly GUIContent SELECT_WORKFLOW = new GUIContent ( "Select the workflow you prefer." ) ;
2023-12-30 17:37:48 +08:00
2024-03-05 17:34:41 +08:00
public static readonly string PAINTING_HEADER = "Painting" ;
public static readonly GUIContent PAINTING_INSTRUCTION = new GUIContent ( "Use a set of painters for hand painting terrain color." ) ;
public static readonly GUIContent CREATE_PAINTER_BTN = new GUIContent ( "Create Geometry - Texture Painter" ) ;
public static readonly string STAMPING_HEADER = "Stamping" ;
public static readonly GUIContent STAMPING_INSTRUCTION = new GUIContent ( "Use stamper to color the terrain procedurally with some rules such as height, normal vector and noise." ) ;
public static readonly GUIContent CREATE_STAMPER_BTN = new GUIContent ( "Create Texture Stamper" ) ;
}
private static void DrawTexturingGUI ( )
{
GEditorCommon . Foldout ( GTexturingGUI . LABEL , false , GTexturingGUI . ID , ( ) = >
2023-12-30 17:37:48 +08:00
{
2024-03-05 17:34:41 +08:00
EditorGUILayout . LabelField ( GTexturingGUI . SELECT_WORKFLOW , GEditorCommon . WordWrapLeftLabel ) ;
2023-12-30 17:37:48 +08:00
2024-03-05 17:34:41 +08:00
GEditorCommon . Header ( GTexturingGUI . PAINTING_HEADER ) ;
EditorGUILayout . LabelField ( GTexturingGUI . PAINTING_INSTRUCTION , GEditorCommon . WordWrapLeftLabel ) ;
if ( GUILayout . Button ( GTexturingGUI . CREATE_PAINTER_BTN ) )
2023-12-30 17:37:48 +08:00
{
GTerrainTexturePainter painter = GWizard . CreateGeometryTexturePainter ( ) ;
EditorGUIUtility . PingObject ( painter . gameObject ) ;
Selection . activeGameObject = painter . gameObject ;
}
2024-03-05 17:34:41 +08:00
GEditorCommon . Header ( GTexturingGUI . STAMPING_HEADER ) ;
EditorGUILayout . LabelField ( GTexturingGUI . STAMPING_INSTRUCTION , GEditorCommon . WordWrapLeftLabel ) ;
if ( GUILayout . Button ( GTexturingGUI . CREATE_STAMPER_BTN ) )
2023-12-30 17:37:48 +08:00
{
GTextureStamper stamper = GWizard . CreateTextureStamper ( ) ;
EditorGUIUtility . PingObject ( stamper . gameObject ) ;
Selection . activeGameObject = stamper . gameObject ;
}
} ) ;
}
2024-03-05 17:34:41 +08:00
private class GVertexColorTexturingGUI
2023-12-30 17:37:48 +08:00
{
2024-03-05 17:34:41 +08:00
public static readonly string LABEL = "4.1. Vertex Color Texturing" ;
public static readonly string ID = "wizard-vertex-color-texturing" ;
2023-12-30 17:37:48 +08:00
2024-03-05 17:34:41 +08:00
public static readonly GUIContent INSTRUCTION_1 = new GUIContent ( "To enable vertex coloring, do the following steps." ) ;
public static readonly GUIContent INSTRUCTION_2 = new GUIContent ( "Set <i>terrain> Geometry> Albedo To Vertex Color</i> to Sharp or Smooth" ) ;
public static readonly GUIContent INSTRUCTION_3 = new GUIContent ( "For Painting workflow: Select the Geometry - Texture Painter and enable <i>Force Update Geometry</i>, then use Albedo mode to paint." ) ;
public static readonly GUIContent INSTRUCTION_4 = new GUIContent ( "For Stamping workflow: Stamp to Albedo map and regenerate terrain meshes by select <i>terrain> Geometry> CONTEXT (≡)> Update</i>" ) ;
}
private static void DrawVertexColorTexturingGUI ( )
{
GEditorCommon . Foldout ( GVertexColorTexturingGUI . LABEL , false , GVertexColorTexturingGUI . ID , ( ) = >
2023-12-30 17:37:48 +08:00
{
EditorGUILayout . LabelField (
2024-03-05 17:34:41 +08:00
GVertexColorTexturingGUI . INSTRUCTION_1 , GEditorCommon . WordWrapLeftLabel ) ;
2023-12-30 17:37:48 +08:00
EditorGUILayout . LabelField (
2024-03-05 17:34:41 +08:00
GVertexColorTexturingGUI . INSTRUCTION_2 , GEditorCommon . RichTextLabel ) ;
2023-12-30 17:37:48 +08:00
EditorGUILayout . LabelField (
2024-03-05 17:34:41 +08:00
GVertexColorTexturingGUI . INSTRUCTION_3 , GEditorCommon . RichTextLabel ) ;
2023-12-30 17:37:48 +08:00
EditorGUILayout . LabelField (
2024-03-05 17:34:41 +08:00
GVertexColorTexturingGUI . INSTRUCTION_4 , GEditorCommon . RichTextLabel ) ;
2023-12-30 17:37:48 +08:00
} ) ;
}
2024-03-05 17:34:41 +08:00
private class GSimulationGUI
{
public static readonly string LABEL = "5. Simulation" ;
public static readonly string ID = "wizard-simulation" ;
public static readonly string INSTRUCTION = "Simulate natural effect such as hydraulic and thermal erosion on the terrain surface." ;
public static readonly string CREATE_SIMULATOR_LABEL = "Create Erosion Simulator" ;
}
private static void DrawSimulationGUI ( )
{
GEditorCommon . Foldout ( GSimulationGUI . LABEL , false , GSimulationGUI . ID , ( ) = >
{
EditorGUILayout . LabelField ( GSimulationGUI . INSTRUCTION , GEditorCommon . WordWrapItalicLabel ) ;
if ( GUILayout . Button ( GSimulationGUI . CREATE_SIMULATOR_LABEL ) )
{
GErosionSimulator simulator = GWizard . CreateErosionSimulator ( ) ;
EditorGUIUtility . PingObject ( simulator ) ;
Selection . activeGameObject = simulator . gameObject ;
}
} ) ;
}
private class GSpawningGUI
2023-12-30 17:37:48 +08:00
{
2024-03-05 17:34:41 +08:00
public static readonly string LABEL = "6. Foliage & Object Spawning" ;
public static readonly string ID = "wizard-foliage-object-spawning" ;
public static readonly GUIContent SELECT_WORKFLOW = new GUIContent ( "Select the workflow you prefer." ) ;
public static readonly string PAINTING_HEADER = "Painting" ;
public static readonly GUIContent PAINTING_INSTRUCTION = new GUIContent ( "Place trees, grasses and game objects by painting." ) ;
public static readonly GUIContent CREATE_PAINTER_BTN = new GUIContent ( "Create Foliage Painter & Object Painter" ) ;
public static readonly string STAMPING_HEADER = "Stamping" ;
public static readonly GUIContent STAMPING_INSTRUCTION = new GUIContent ( "Procedurally spawn trees, grasses and game objects using some rules such as height, normal vector and noise." ) ;
public static readonly GUIContent CREATE_STAMPER_BTN = new GUIContent ( "Create Foliage Stamper & Object Stamper" ) ;
}
2023-12-30 17:37:48 +08:00
2024-03-05 17:34:41 +08:00
private static void DrawFoliageAndObjectSpawningGUI ( )
{
GEditorCommon . Foldout ( GSpawningGUI . LABEL , false , GSpawningGUI . ID , ( ) = >
2023-12-30 17:37:48 +08:00
{
2024-03-05 17:34:41 +08:00
EditorGUILayout . LabelField ( GSpawningGUI . SELECT_WORKFLOW , GEditorCommon . WordWrapLeftLabel ) ;
2023-12-30 17:37:48 +08:00
2024-03-05 17:34:41 +08:00
GEditorCommon . Header ( GSpawningGUI . PAINTING_HEADER ) ;
EditorGUILayout . LabelField ( GSpawningGUI . PAINTING_INSTRUCTION , GEditorCommon . WordWrapLeftLabel ) ;
if ( GUILayout . Button ( GSpawningGUI . CREATE_PAINTER_BTN ) )
2023-12-30 17:37:48 +08:00
{
GFoliagePainter fPainter = GWizard . CreateFoliagePainter ( ) ;
GObjectPainter oPainter = GWizard . CreateObjectPainter ( ) ;
EditorGUIUtility . PingObject ( fPainter ) ;
Selection . objects = new GameObject [ ] { fPainter . gameObject , oPainter . gameObject } ;
Selection . activeGameObject = fPainter . gameObject ;
}
2024-03-05 17:34:41 +08:00
GEditorCommon . Header ( GSpawningGUI . STAMPING_HEADER ) ;
EditorGUILayout . LabelField ( GSpawningGUI . STAMPING_INSTRUCTION , GEditorCommon . WordWrapLeftLabel ) ;
if ( GUILayout . Button ( GSpawningGUI . CREATE_STAMPER_BTN ) )
2023-12-30 17:37:48 +08:00
{
GFoliageStamper fStamper = GWizard . CreateFoliageStamper ( ) ;
GObjectStamper oStamper = GWizard . CreateObjectStamper ( ) ;
EditorGUIUtility . PingObject ( fStamper ) ;
Selection . objects = new GameObject [ ] { fStamper . gameObject , oStamper . gameObject } ;
Selection . activeGameObject = fStamper . gameObject ;
}
} ) ;
}
2024-03-05 17:34:41 +08:00
private class GCreateSplineGUI
2023-12-30 17:37:48 +08:00
{
2024-03-05 17:34:41 +08:00
public static readonly string LABEL = "7. Create Roads, Ramps, Rivers, etc." ;
public static readonly string ID = "wizard-spline" ;
public static readonly GUIContent INSTRUCTION = new GUIContent ( "Use Spline Tool to paint roads, make ramps and riverbeds, etc." ) ;
public static readonly GUIContent CREATE_BTN = new GUIContent ( "Create Spline Tool" ) ;
}
2023-12-30 17:37:48 +08:00
2024-03-05 17:34:41 +08:00
private static void DrawCreateSplineGUI ( )
{
GEditorCommon . Foldout ( GCreateSplineGUI . LABEL , false , GCreateSplineGUI . ID , ( ) = >
2023-12-30 17:37:48 +08:00
{
2024-03-05 17:34:41 +08:00
EditorGUILayout . LabelField ( GCreateSplineGUI . INSTRUCTION , GEditorCommon . WordWrapLeftLabel ) ;
if ( GUILayout . Button ( GCreateSplineGUI . CREATE_BTN ) )
2023-12-30 17:37:48 +08:00
{
GSplineCreator spline = GWizard . CreateSplineTool ( ) ;
EditorGUIUtility . PingObject ( spline ) ;
Selection . activeGameObject = spline . gameObject ;
}
} ) ;
}
2024-03-05 17:34:41 +08:00
private class GWaterSkyGUI
2023-12-30 17:37:48 +08:00
{
2024-03-05 17:34:41 +08:00
public static readonly string LABEL = "8. Adding Water & Sky" ;
public static readonly string ID = "wizard-id" ;
public static readonly string WATER_HEADER = "Water" ;
public static readonly GUIContent WATER_INSTRUCTION = new GUIContent ( "Poseidon is a low poly water system with high visual quality and performance." ) ;
public static readonly GUIContent GET_POSEIDON_BTN = new GUIContent ( "Get Poseidon" ) ;
public static readonly string SKY_HEADER = "Sky" ;
public static readonly GUIContent SKY_INSTRUCTION = new GUIContent ( "Jupiter is a single pass sky shader with day night cycle support." ) ;
public static readonly GUIContent GET_JUPITER_BTN = new GUIContent ( "Get Jupiter" ) ;
}
2023-12-30 17:37:48 +08:00
2024-03-05 17:34:41 +08:00
private static void DrawWaterSkyGUI ( )
{
GEditorCommon . Foldout ( GWaterSkyGUI . LABEL , false , GWaterSkyGUI . ID , ( ) = >
2023-12-30 17:37:48 +08:00
{
2024-03-05 17:34:41 +08:00
GEditorCommon . Header ( GWaterSkyGUI . WATER_HEADER ) ;
EditorGUILayout . LabelField ( GWaterSkyGUI . WATER_INSTRUCTION , GEditorCommon . WordWrapLeftLabel ) ;
if ( GUILayout . Button ( GWaterSkyGUI . GET_POSEIDON_BTN ) )
2023-12-30 17:37:48 +08:00
{
Application . OpenURL ( GAssetLink . POSEIDON ) ;
}
2024-03-05 17:34:41 +08:00
GEditorCommon . Header ( GWaterSkyGUI . SKY_HEADER ) ;
2023-12-30 17:37:48 +08:00
EditorGUILayout . LabelField (
2024-03-05 17:34:41 +08:00
GWaterSkyGUI . SKY_INSTRUCTION , GEditorCommon . WordWrapLeftLabel ) ;
if ( GUILayout . Button ( GWaterSkyGUI . GET_JUPITER_BTN ) )
2023-12-30 17:37:48 +08:00
{
Application . OpenURL ( GAssetLink . JUPITER ) ;
}
} ) ;
}
2024-03-05 17:34:41 +08:00
private class GUtilitiesGUI
2023-12-30 17:37:48 +08:00
{
2024-03-05 17:34:41 +08:00
public static readonly string LABEL = "9. Utilities" ;
public static readonly string ID = "wizard-utilities" ;
2023-12-30 17:37:48 +08:00
2024-03-05 17:34:41 +08:00
public static readonly string WIND_ZONE_HEADER = "Wind Zone" ;
public static readonly GUIContent WIND_ZONE_INSTRUCTION = new GUIContent ( "Adding Wind Zone to customize how grass react to wind in this level." ) ;
public static readonly GUIContent CREATE_WIND_ZONE_BTN = new GUIContent ( "Create Wind Zone" ) ;
}
private static void DrawUtilitiesGUI ( )
{
GEditorCommon . Foldout ( GUtilitiesGUI . LABEL , false , GUtilitiesGUI . ID , ( ) = >
2023-12-30 17:37:48 +08:00
{
2024-03-05 17:34:41 +08:00
GEditorCommon . Header ( GUtilitiesGUI . WIND_ZONE_HEADER ) ;
EditorGUILayout . LabelField ( GUtilitiesGUI . WIND_ZONE_INSTRUCTION ) ;
if ( GUILayout . Button ( GUtilitiesGUI . CREATE_WIND_ZONE_BTN ) )
2023-12-30 17:37:48 +08:00
{
GWindZone wind = GWizard . CreateWindZone ( ) ;
EditorGUIUtility . PingObject ( wind . gameObject ) ;
Selection . activeGameObject = wind . gameObject ;
}
} ) ;
}
}
}
2024-03-05 17:34:41 +08:00
#endif