You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
981 B
26 lines
981 B
using System;
|
|
using UnityEditor.ShaderGraph;
|
|
using UnityEngine.Rendering;
|
|
|
|
namespace UnityEditor.Rendering.BuiltIn.ShaderGraph
|
|
{
|
|
static class CreateCanvasShadergraph
|
|
{
|
|
[MenuItem("Assets/Create/Shader Graph/BuiltIn/Canvas Shader Graph", priority = CoreUtils.Sections.section1 + CoreUtils.Priorities.assetsCreateShaderMenuPriority + 2)]
|
|
public static void CreateUnlitGraph()
|
|
{
|
|
var target = (BuiltInTarget)Activator.CreateInstance(typeof(BuiltInTarget));
|
|
target.TrySetActiveSubTarget(typeof(BuiltInCanvasSubTarget));
|
|
|
|
var blockDescriptors = new[]
|
|
{
|
|
BlockFields.SurfaceDescription.BaseColor,
|
|
BlockFields.SurfaceDescription.Emission,
|
|
BlockFields.SurfaceDescription.Alpha,
|
|
BlockFields.SurfaceDescription.AlphaClipThreshold,
|
|
};
|
|
|
|
GraphUtil.CreateNewGraphWithOutputs(new[] { target }, blockDescriptors);
|
|
}
|
|
}
|
|
}
|