mathe/Library/PackageCache/com.unity.shadergraph@14.0.8/Editor/Generation/Targets/CustomRenderTexture/CreateCustomRenderTextureShaderGraph.cs
2024-09-20 20:30:10 +02:00

25 lines
909 B
C#

using System;
using UnityEditor.ShaderGraph;
using UnityEngine.Rendering;
namespace UnityEditor.Rendering.CustomRenderTexture.ShaderGraph
{
public static class CustomTextureShaderGraphMenu
{
[MenuItem("Assets/Create/Shader Graph/Custom Render Texture", priority = CoreUtils.Sections.section3 + CoreUtils.Priorities.assetsCreateShaderMenuPriority)]
public static void CreateCustomTextureShaderGraph()
{
var target = (CustomRenderTextureTarget)Activator.CreateInstance(typeof(CustomRenderTextureTarget));
target.TrySetActiveSubTarget(typeof(CustomTextureSubTarget));
var blockDescriptors = new[]
{
BlockFields.SurfaceDescription.BaseColor,
BlockFields.SurfaceDescription.Alpha,
};
GraphUtil.CreateNewGraphWithOutputs(new[] { target }, blockDescriptors);
}
}
}