BITFALL/Assets/Plugins/Polaris - Low Poly Ecosystem/Polaris - Low Poly Terrain .../Editor/Scripts/WizardTool/GSetShaderTabDrawer.cs

50 lines
1.6 KiB
C#
Raw Normal View History

2024-03-05 17:34:41 +08:00
#if GRIFFIN
2023-12-30 17:37:48 +08:00
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
namespace Pinwheel.Griffin.Wizard
{
public static class GSetShaderTabDrawer
{
2024-03-05 17:34:41 +08:00
private class GSetShaderTabGUI
{
public static readonly GUIContent GROUP_ID = new GUIContent("Group Id", "Id of the terrain group to change the material");
public static readonly GUIContent TERRAIN = new GUIContent("Terrain", "The terrain to change its material");
public static readonly GUIContent SET_BTN = new GUIContent("Set");
}
2023-12-30 17:37:48 +08:00
internal static bool bulkSetShader = true;
internal static void Draw()
{
GEditorSettings.WizardToolsSettings settings = GEditorSettings.Instance.wizardTools;
if (bulkSetShader)
{
2024-03-05 17:34:41 +08:00
settings.setShaderGroupId = GEditorCommon.ActiveTerrainGroupPopupWithAllOption(GSetShaderTabGUI.GROUP_ID, settings.setShaderGroupId);
2023-12-30 17:37:48 +08:00
}
else
{
2024-03-05 17:34:41 +08:00
settings.setShaderTerrain = EditorGUILayout.ObjectField(GSetShaderTabGUI.TERRAIN, settings.setShaderTerrain, typeof(GStylizedTerrain), true) as GStylizedTerrain;
2023-12-30 17:37:48 +08:00
}
GWizardEditorCommon.DrawMaterialSettingsGUI();
2024-03-05 17:34:41 +08:00
if (GUILayout.Button(GSetShaderTabGUI.SET_BTN))
2023-12-30 17:37:48 +08:00
{
if (bulkSetShader)
{
GWizard.SetShader(settings.setShaderGroupId);
}
else
{
GWizard.SetShader(settings.setShaderTerrain);
}
}
}
}
}
2024-03-05 17:34:41 +08:00
#endif