浏览代码

Use helper function to figure out if we have warnings or errors.

/main
Tim Cooper 7 年前
当前提交
a13c3ee9
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 6
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Graphs/MaterialGraphAsset.cs

6
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Graphs/MaterialGraphAsset.cs


using System;
using System.Linq;
using UnityEngine;
using System.Reflection;

{
public static bool ShaderHasError(Shader shader)
{
var hasErrorsCall = typeof(ShaderUtil).GetMethod("GetShaderErrorCount", BindingFlags.Static | BindingFlags.NonPublic);
var result = hasErrorsCall.Invoke(null, new object[] { shader });
return (int)result != 0;
var errors = GetShaderErrors(shader);
return errors.Any(x => x.warning == 0);
}
public struct ShaderError

正在加载...
取消
保存