浏览代码

Small Fixes

/main
Thomas Iché 5 年前
当前提交
9e0b4691
共有 2 个文件被更改,包括 91 次插入17 次删除
  1. 96
      Editor/WelcomeScreen/WelcomeScreen.Setup.cs
  2. 12
      Editor/WelcomeScreen/WelcomeScreen.cs

96
Editor/WelcomeScreen/WelcomeScreen.Setup.cs


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(12);
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(12);
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(12);
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(16);
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(12);
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(16);
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);
}
}
}

12
Editor/WelcomeScreen/WelcomeScreen.cs


{
GUILayout.Label("Gameplay Ingredients", Styles.centeredTitle);
GUILayout.Label(@"Simple, Organic, Open Source
GUILayout.Label(@"(and cooking ustensils)
A set of Runtime and Editor Tools for your unity prototypes and games. Released under MIT License as a unity package.
A set of Open Source Runtime and Editor Tools for your Unity prototypes and games. These scripts are maintained by Thomas Iche and released under MIT License as a unity package.
This package also makes use of the following third party components:
* Naughty Attributes by Denis Rizov (https://github.com/dbrizov)
* Fugue Icons by Yusuke Kamiyamane (https://p.yusukekamiyamane.com/).
* Header art background 'Chef's Station' made by Todd Quackenbush, released on unspash.com (https://unsplash.com/photos/x5SRhkFajrA).
<b>This package also makes use of the following third party components:</b>
- <i>Naughty Attributes</i> by Denis Rizov (https://github.com/dbrizov)
- <i>Fugue Icons</i> by Yusuke Kamiyamane (https://p.yusukekamiyamane.com/).
- <i>Header art background 'Chef's Station'</i> by Todd Quackenbush (https://unsplash.com/photos/x5SRhkFajrA).
", Styles.centeredBody);
using (new GUILayout.HorizontalScope())

正在加载...
取消
保存