using System.Collections ;
using System ;
using System.Collections.Generic ;
using UnityEngine ;
using UnityEditor ;
using ( new GUILayout . VerticalScope ( Styles . helpBox ) )
{
GUILayout . Label ( "Welcome to Gameplay Ingredients !" , Styles . title ) ;
GUILayout . Space ( 1 2 ) ;
GUILayout . Label ( @ "This wizard will help you set up your project so you can use and customize scripts.
pages [ currentPage ] . Invoke ( ) ;
GameplayIngredients is a framework that comes with a variety of features : these can be configured in a < b > GameplayIngredientsSettings < / b > asset .
GUILayout . FlexibleSpace ( ) ;
using ( new GUILayout . HorizontalScope ( ) )
{
GUILayout . FlexibleSpace ( ) ;
EditorGUI . BeginDisabledGroup ( currentPage = = 0 ) ;
if ( GUILayout . Button ( "Back" ) )
{
currentPage - - ;
}
EditorGUI . EndDisabledGroup ( ) ;
EditorGUI . BeginDisabledGroup ( currentPage = = pages . Length - 1 ) ;
if ( GUILayout . Button ( "Next" ) )
{
currentPage + + ;
}
EditorGUI . EndDisabledGroup ( ) ;
}
}
}
public int currentPage = 0 ;
public Action [ ] pages = new Action [ ]
{
WelcomePage , SettingAssetPage , UnpackPackagePage
} ;
static void WelcomePage ( )
{
GUILayout . Label ( "Welcome to Gameplay Ingredients !" , Styles . title ) ;
GUILayout . Space ( 1 2 ) ;
GUILayout . Label ( @"This wizard will help you set up your project so you can use and customize scripts." , Styles . body ) ;
}
const string kSettingsAssetPath = "Assets/Resources/GameplayIngredientsSettings.asset" ;
static void SettingAssetPage ( )
{
GUILayout . Label ( "Creating a Settings Asset" , Styles . title ) ;
GUILayout . Space ( 1 2 ) ;
GUILayout . Label ( @ "GameplayIngredients is a framework that comes with a variety of features : these can be configured in a <b>GameplayIngredientsSettings</b> asset.
While this is not mandatory we advise you to create it in order to be able to modify it .
While this is not mandatory we advise you to create it in order to be able to modify it for your project ' s needs .
GUILayout . Space ( 8 ) ;
using ( new GUILayout . HorizontalScope ( ) )
GUILayout . Space ( 1 6 ) ;
using ( new GUILayout . HorizontalScope ( ) )
{
GUILayout . FlexibleSpace ( ) ;
if ( GUILayout . Button ( "Create GameplayIngredientsSettings Asset" ) )
GUILayout . FlexibleSpace ( ) ;
if ( GUILayout . Button ( "Create GameplayIngredientsSettings Asset" ) )
bool create = true ;
if ( System . IO . File . Exists ( Application . dataPath + "/" + kSettingsAssetPath ) )
if ( ! EditorUtility . DisplayDialog ( "GameplayIngredientsSettings Asset Overwrite" , "A GameplayIngredientsSettings Asset already exists, do you want to overwrite it?" , "Yes" , "No" ) )
create = false ;
}
if ( create )
{
if ( ! System . IO . Directory . Exists ( Application . dataPath + "/Assets/Resources" ) )
AssetDatabase . CreateFolder ( "Assets" , "Resources" ) ;
AssetDatabase . CreateAsset ( asset , "Assets/Resources/GameplayIngredientsSettings.asset" ) ;
AssetDatabase . CreateAsset ( asset , kSettingsAssetPath ) ;
}
}
static void UnpackPackagePage ( )
{
GUILayout . Label ( "Unpacking Starter Content" , Styles . title ) ;
GUILayout . Space ( 1 2 ) ;
GUILayout . Label ( @ "In order to customize your project, you can create default assets that you will be able to customize.
Please select a package depending on your project ' s render loop . If you do not know about render loops , you will probably need the Legacy Package . ", Styles.body);
GUILayout . Space ( 1 6 ) ;
using ( new GUILayout . HorizontalScope ( ) )
{
using ( new GUILayout . VerticalScope ( ) )
{
if ( GUILayout . Button ( "Legacy Renderer" ) )
AssetDatabase . ImportPackage ( "Packages/net.peeweek.gameplay-ingredients/StarterAssets/GameplayIngredients-Starter-LegacyRenderer.unitypackage" , false ) ;
if ( GUILayout . Button ( "HD Render Pipeline" ) )
AssetDatabase . ImportPackage ( "Packages/net.peeweek.gameplay-ingredients/StarterAssets/GameplayIngredients-Starter-HDRP.unitypackage" , false ) ;
if ( GUILayout . Button ( "Lightweight Render Pipeline" ) )
AssetDatabase . ImportPackage ( "Packages/net.peeweek.gameplay-ingredients/StarterAssets/GameplayIngredients-Starter-LWRP.unitypackage" , false ) ;
}
}
}