Paul Demeulenaere
8 年前
当前提交
2c0192a0
共有 5 个文件被更改,包括 94 次插入 和 10 次删除
-
9MaterialGraphProject/Assets/UnityShaderEditor/Runtime/SubGraph/SubGraphNode.cs
-
22MaterialGraphProject/Assets/UnityShaderEditor/Runtime/SurfaceModel/AbstractSurfaceMasterNode.cs
-
16MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Util/ShaderGenerator.cs
-
45MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/VertexColorNode.cs
-
12MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/VertexColorNode.cs.meta
|
|||
using System.ComponentModel; |
|||
using UnityEngine.Graphing; |
|||
|
|||
namespace UnityEngine.MaterialGraph |
|||
{ |
|||
interface IMayRequireVertexColor |
|||
{ |
|||
bool RequiresVertexColor(); |
|||
} |
|||
|
|||
[Title("Input/Vertex Color Node")] |
|||
public class VertexColorNode : AbstractMaterialNode, IMayRequireVertexColor |
|||
{ |
|||
private const int kOutputSlotId = 0; |
|||
private const string kOutputSlotName = "VertexColor"; |
|||
|
|||
public override bool hasPreview { get { return true; } } |
|||
public override PreviewMode previewMode |
|||
{ |
|||
get { return PreviewMode.Preview3D; } |
|||
} |
|||
|
|||
public VertexColorNode() |
|||
{ |
|||
name = "Vertex Color"; |
|||
UpdateNodeAfterDeserialization(); |
|||
} |
|||
|
|||
public sealed override void UpdateNodeAfterDeserialization() |
|||
{ |
|||
AddSlot(new MaterialSlot(kOutputSlotId, kOutputSlotName, kOutputSlotName, SlotType.Output, SlotValueType.Vector4, Vector4.one)); |
|||
RemoveSlotsNameNotMatching(new[] { kOutputSlotId }); |
|||
} |
|||
|
|||
public override string GetVariableNameForSlot(int slotId) |
|||
{ |
|||
return ShaderGeneratorNames.VertexColor; |
|||
} |
|||
|
|||
public bool RequiresVertexColor() |
|||
{ |
|||
return true; |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 923cdcd772822d84b9d79807e27d502b |
|||
timeCreated: 1481123160 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue