浏览代码

Change Comparison func convert to switch

/main
Matt Dean 7 年前
当前提交
b1dc4ab4
共有 1 个文件被更改,包括 15 次插入1 次删除
  1. 16
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Utility/Logic/ComparisonNode.cs

16
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Utility/Logic/ComparisonNode.cs


protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod(string.Format("Unity_Comparison_{0}", comparisonType), BindingFlags.Static | BindingFlags.NonPublic);
switch(comparisonType)
{
case ComparisonType.NotEqual:
return GetType().GetMethod("Unity_Comparison_NotEqual", BindingFlags.Static | BindingFlags.NonPublic);
case ComparisonType.Less:
return GetType().GetMethod("Unity_Comparison_Less", BindingFlags.Static | BindingFlags.NonPublic);
case ComparisonType.LessOrEqual:
return GetType().GetMethod("Unity_Comparison_LessOrEqual", BindingFlags.Static | BindingFlags.NonPublic);
case ComparisonType.Greater:
return GetType().GetMethod("Unity_Comparison_Greater", BindingFlags.Static | BindingFlags.NonPublic);
case ComparisonType.GreaterOrEqual:
return GetType().GetMethod("Unity_Comparison_GreaterOrEqual", BindingFlags.Static | BindingFlags.NonPublic);
default:
return GetType().GetMethod("Unity_Comparison_Equal", BindingFlags.Static | BindingFlags.NonPublic);
}
}
static string Unity_Comparison_Equal(

正在加载...
取消
保存