您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
34 行
920 B
34 行
920 B
using UnityEngine.Graphing;
|
|
|
|
namespace UnityEngine.MaterialGraph
|
|
{
|
|
[Title("Input/Geometry/Position")]
|
|
public class PositionNode : AbstractMaterialNode
|
|
{
|
|
const string kOutputSlotName = "XYZW";
|
|
|
|
public const int OutputSlotId = 0;
|
|
|
|
public PositionNode()
|
|
{
|
|
name = "Position";
|
|
UpdateNodeAfterDeserialization();
|
|
}
|
|
|
|
public sealed override void UpdateNodeAfterDeserialization()
|
|
{
|
|
AddSlot(new MaterialSlot(OutputSlotId, kOutputSlotName, kOutputSlotName, SlotType.Output, SlotValueType.Vector4, Vector4.zero, ShaderStage.Vertex));
|
|
RemoveSlotsNameNotMatching(validSlots);
|
|
}
|
|
|
|
protected int[] validSlots
|
|
{
|
|
get { return new[] { OutputSlotId }; }
|
|
}
|
|
|
|
public override string GetVariableNameForSlot(int slotId)
|
|
{
|
|
return "v.vertex";
|
|
}
|
|
}
|
|
}
|