您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
34 行
811 B
34 行
811 B
using System.Reflection;
|
|
|
|
namespace UnityEngine.MaterialGraph
|
|
{
|
|
[Title("Normal/Blend Normal")]
|
|
public class BlendNormalNode : CodeFunctionNode
|
|
{
|
|
public BlendNormalNode()
|
|
{
|
|
name = "BlendNormal";
|
|
}
|
|
|
|
protected override MethodInfo GetFunctionToConvert()
|
|
{
|
|
return GetType().GetMethod("Unity_Blendnormal", BindingFlags.Static | BindingFlags.NonPublic);
|
|
}
|
|
|
|
static string Unity_Blendnormal(
|
|
[Slot(0, Binding.None)] Vector3 first,
|
|
[Slot(1, Binding.None)] Vector3 second,
|
|
[Slot(2, Binding.None)] out Vector3 result)
|
|
{
|
|
result = Vector3.one;
|
|
|
|
return @"
|
|
{
|
|
result = normalize({precision}3(first.rg + second.rg, first.b * second.b));
|
|
}
|
|
";
|
|
}
|
|
}
|
|
}
|
|
|
|
|