浏览代码

Move GeneratedShader outside Unity project

/main
Peter Bay Bastian 7 年前
当前提交
8139e3cb
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 2
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/NodePreviewPresenter.cs

2
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/NodePreviewPresenter.cs


var resultShader = GetPreviewShaderString();
Debug.Log("RecreateShaderAndMaterial : " + m_Node.GetVariableNameForNode() + Environment.NewLine + resultShader);
string shaderOuputString = resultShader.Replace("UnityEngine.MaterialGraph", "Generated");
System.IO.File.WriteAllText(Application.dataPath + "/GeneratedShader.shader", shaderOuputString);
System.IO.File.WriteAllText(Application.dataPath + "/../GeneratedShader.shader", shaderOuputString);
if (string.IsNullOrEmpty(resultShader))
return false;

正在加载...
取消
保存