Tim Cooper
7 年前
当前提交
79841e4c
共有 10 个文件被更改,包括 199 次插入 和 31 次删除
-
2MaterialGraphProject/Assets/UnityShaderEditor/Editor/AssetCallbacks/CreateShaderGraph.cs
-
13MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/AbstractMaterialGraphEditWindow.cs
-
62MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/GraphInspectorView.cs
-
37MaterialGraphProject/Assets/UnityShaderEditor/Editor/Importers/ShaderGraphImporter.cs
-
2MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Graphs/IShaderGraph.cs
-
20MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Interfaces/MaterialGraphChange.cs
-
2MaterialGraphProject/Assets/UnityShaderEditor/Runtime/SubGraph/LayerWeightsOutputNode.cs
-
65MaterialGraphProject/Assets/UnityShaderEditor/Runtime/SubGraph/LayeredShaderGraph.cs
-
24MaterialGraphProject/Assets/UnityShaderEditor/Editor/AssetCallbacks/CreateLayeredShaderGraph.cs
-
3MaterialGraphProject/Assets/UnityShaderEditor/Editor/AssetCallbacks/CreateLayeredShaderGraph.cs.meta
|
|||
using System.IO; |
|||
using UnityEditor.ProjectWindowCallback; |
|||
using UnityEngine.MaterialGraph; |
|||
|
|||
namespace UnityEditor.MaterialGraph |
|||
{ |
|||
public class CreateLayeredShaderGraph : EndNameEditAction |
|||
{ |
|||
[MenuItem("Assets/Create/Layered Shader Graph", false, 208)] |
|||
public static void CreateLayeredGraph() |
|||
{ |
|||
ProjectWindowUtil.StartNameEditingIfProjectWindowExists(0, CreateInstance<CreateLayeredShaderGraph>(), |
|||
"New Layerd Shader Graph.LayeredShaderGraph", null, null); |
|||
} |
|||
|
|||
public override void Action(int instanceId, string pathName, string resourceFile) |
|||
{ |
|||
var graph = new LayeredShaderGraph(); |
|||
graph.AddNode(new LayerWeightsOutputNode()); |
|||
File.WriteAllText(pathName, EditorJsonUtility.ToJson(graph)); |
|||
AssetDatabase.Refresh(); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 0c11588a25854ed5bd03171503c84789 |
|||
timeCreated: 1507403047 |
撰写
预览
正在加载...
取消
保存
Reference in new issue