Files
com.misaki.art-tools/Editor/AssetsHelpers/Helpers/AssetCreationHelpers.cs

18 lines
526 B
C#

using UnityEditor;
using UnityEngine;
using UnityEngine.Rendering.HighDefinition;
namespace Misaki.ArtToolEditor
{
public static class AssetCreationHelpers
{
public static GameObject CreateDecal(string path)
{
var decal = new GameObject("Temp_Decal");
decal.AddComponent<DecalProjector>();
PrefabUtility.SaveAsPrefabAsset(decal, path);
Object.DestroyImmediate(decal);
return AssetDatabase.LoadAssetAtPath<GameObject>(path);
}
}
}