34 lines
1018 B
C#
34 lines
1018 B
C#
using UnityEditor;
|
|
using UnityEngine;
|
|
|
|
namespace Misaki.ArtToolEditor
|
|
{
|
|
public class CreateTerrainLayerMenu
|
|
{
|
|
private const string Terrain_Layer_Extension = ".terrainlayer";
|
|
|
|
[MenuItem("Assets/Art Tools/Material Helpers/Create Terrain Layer", true)]
|
|
public static bool CreateTerrainLayerValidator()
|
|
{
|
|
foreach (var selectedObject in Selection.objects)
|
|
{
|
|
if (selectedObject is not Material)
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
[MenuItem("Assets/Art Tools/Material Helpers/Create Terrain Layer")]
|
|
public static void CreateTerrainLayer()
|
|
{
|
|
var window = EditorWindow.GetWindow<OutputOptionsWindow>(true, "Extract Materials Output Options");
|
|
window.WithItemSource(Selection.objects);
|
|
window.RegisterProcessor<CreateTerrainLayerProcessor>();
|
|
|
|
window.InitializeAndShow();
|
|
}
|
|
}
|
|
} |