您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

23 行
777 B

using System.IO;
using UnityEditor.ProjectWindowCallback;
using UnityEditor.ShaderGraph;
namespace UnityEditor.ShaderGraph
{
public class CreateRemapGraph : EndNameEditAction
{
[MenuItem("Assets/Create/Shader Remap Graph", false, 209)]
public static void CreateMaterialRemapGraph()
{
ProjectWindowUtil.StartNameEditingIfProjectWindowExists(0, CreateInstance<CreateRemapGraph>(),
"New Remap-Graph.ShaderRemapGraph", null, null);
}
public override void Action(int instanceId, string pathName, string resourceFile)
{
var graph = new MasterRemapGraph();
File.WriteAllText(pathName, EditorJsonUtility.ToJson(graph));
AssetDatabase.Refresh();
}
}
}