您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

30 行
1.0 KiB

using UnityEngine;
using UnityEditor.Graphing;
namespace UnityEditor.ShaderGraph
{
[Title("Vertex Interpolation")]
public class VertexInterpolatorNode : AbstractMaterialNode
{
const string k_InputSlotName = "In";
const string k_OutputSlotName = "Out";
public const int InputSlotId = 0;
public const int OutputSlotId = 1;
public VertexInterpolatorNode()
{
name = "Position";
UpdateNodeAfterDeserialization();
}
public sealed override void UpdateNodeAfterDeserialization()
{
AddSlot(new DynamicVectorMaterialSlot(InputSlotId, k_InputSlotName, k_InputSlotName, SlotType.Input, Vector4.zero, ShaderStage.Vertex));
AddSlot(new DynamicVectorMaterialSlot(OutputSlotId, k_OutputSlotName, k_OutputSlotName, SlotType.Output, Vector4.zero, ShaderStage.Fragment));
RemoveSlotsNameNotMatching(k_ValidSlots);
}
static readonly int[] k_ValidSlots = { InputSlotId, OutputSlotId };
}
}