Unity-NorthStar / data /Packages /com.unity.render-pipelines.universal /Editor /ShaderGraph /AssetCallbacks /CreateCanvasShaderGraph.cs
| using System; | |
| using UnityEditor.ShaderGraph; | |
| using UnityEngine.Rendering; | |
| using UnityEditor.Rendering.Fullscreen.ShaderGraph; | |
| namespace UnityEditor.Rendering.Universal.ShaderGraph | |
| { | |
| static class CreateCanvasShaderGraph | |
| { | |
| [] | |
| public static void CreateCanvasGraph() | |
| { | |
| var target = (UniversalTarget)Activator.CreateInstance(typeof(UniversalTarget)); | |
| target.TrySetActiveSubTarget(typeof(UniversalCanvasSubTarget)); | |
| var blockDescriptors = new[] | |
| { | |
| BlockFields.SurfaceDescription.BaseColor, | |
| BlockFields.SurfaceDescription.Emission, | |
| BlockFields.SurfaceDescription.Alpha, | |
| BlockFields.SurfaceDescription.AlphaClipThreshold, | |
| }; | |
| GraphUtil.CreateNewGraphWithOutputs(new[] { target }, blockDescriptors); | |
| } | |
| } | |
| } | |