浏览代码

[FIX] #157 Removed the check for Master node which casued the Exception.

/main
Martin Thorzen 7 年前
当前提交
f243e1cf
共有 2 个文件被更改,包括 4 次插入3 次删除
  1. 3
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/MaterialGraphEditWindow.cs
  2. 4
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Importers/ShaderGraphImporter.cs

3
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/MaterialGraphEditWindow.cs


if (graph == null)
return;
List<PropertyCollector.TextureInfo> configuredTextures;
graph.GetShader(Path.GetFileNameWithoutExtension(path), GenerationMode.ForReals, out configuredTextures);
var shaderImporter = AssetImporter.GetAtPath(path) as ShaderGraphImporter;
if (shaderImporter == null)
return;

4
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Importers/ShaderGraphImporter.cs


var text = GetShaderText<MaterialGraph>(ctx.assetPath, out configuredTextures);
if (text == null)
text = errorShader;
var name = Path.GetFileNameWithoutExtension(ctx.assetPath);
string shaderName = string.Format("graphs/{0}", name);
text = text.Replace("Hidden/GraphErrorShader2", shaderName);
var shader = ShaderUtil.CreateShaderAsset(text);

正在加载...
取消
保存