testss
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
@@ -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
|
Reference in New Issue
Block a user