Rasagar/Library/PackageCache/com.unity.shadergraph/Editor/Generation/Targets/CustomRenderTexture/CreateCustomRenderTextureShaderGraph.cs
2024-08-26 23:07:20 +03: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);
}
}
}