18 lines
526 B
C#
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);
|
|
}
|
|
}
|
|
} |