This commit is contained in:
2021-06-13 10:28:03 +02:00
parent eb70603c85
commit df2d24cbd3
7487 changed files with 943244 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
using UnityEngine;
namespace UnityEditor.ShaderGraph
{
static class CreateShaderGraph
{
[MenuItem("Assets/Create/Shader/Blank Shader Graph", false, 208)]
public static void CreateBlankShaderGraph()
{
GraphUtil.CreateNewGraph();
}
}
}

View File

@@ -0,0 +1,27 @@
using System.IO;
using UnityEditor.ProjectWindowCallback;
namespace UnityEditor.ShaderGraph
{
class CreateShaderSubGraph : EndNameEditAction
{
[MenuItem("Assets/Create/Shader/Sub Graph", false, 208)]
public static void CreateMaterialSubGraph()
{
ProjectWindowUtil.StartNameEditingIfProjectWindowExists(0, CreateInstance<CreateShaderSubGraph>(),
string.Format("New Shader Sub Graph.{0}", ShaderSubGraphImporter.Extension), null, null);
}
public override void Action(int instanceId, string pathName, string resourceFile)
{
var graph = new GraphData { isSubGraph = true };
var outputNode = new SubGraphOutputNode();
graph.AddNode(outputNode);
graph.outputNode = outputNode;
outputNode.AddSlot(ConcreteSlotValueType.Vector4);
graph.path = "Sub Graphs";
FileUtilities.WriteShaderGraphToDisk(pathName, graph);
AssetDatabase.Refresh();
}
}
}

View File

@@ -0,0 +1,23 @@
#if VFX_GRAPH_10_0_0_OR_NEWER
using System;
using UnityEditor.ShaderGraph;
namespace UnityEditor.ShaderGraph
{
static class CreateVFXShaderGraph
{
[MenuItem("Assets/Create/Shader/VFX Shader Graph", false, 208)]
public static void CreateVFXGraph()
{
var target = (VFXTarget)Activator.CreateInstance(typeof(VFXTarget));
var blockDescriptors = new[]
{
BlockFields.SurfaceDescription.BaseColor,
BlockFields.SurfaceDescription.Alpha,
};
GraphUtil.CreateNewGraphWithOutputs(new[] {target}, blockDescriptors);
}
}
}
#endif