Files
com.misaki.art-tools/Editor/AssetsHelpers/Implementation/Material/CreateDecal/CreateDecalMenu.cs
2024-12-26 00:44:11 +09:00

33 lines
944 B
C#

using UnityEditor;
using UnityEngine;
namespace Misaki.ArtToolEditor
{
internal class CreateDecalMenu
{
[MenuItem("Assets/Art Tools/Material Helpers/Create Decal", true)]
public static bool CreateDecalValidator()
{
foreach (var selectedObject in Selection.objects)
{
if (selectedObject is not Material)
{
return false;
}
}
return true;
}
[MenuItem("Assets/Art Tools/Material Helpers/Create Decal")]
public static void CreateDecal()
{
var createDecal = new CreateDecalMenu();
var window = EditorWindow.GetWindow<OutputOptionsWindow>(true, "Decal Output Options");
window.WithItemSource(Selection.objects);
window.RegisterProcessor<CreateDecalProcessor>();
window.InitializeAndShow();
}
}
}