浏览代码

Added unlit master node

/main
Matt Dean 8 年前
当前提交
a51e8de3
共有 2 个文件被更改,包括 75 次插入0 次删除
  1. 63
      MaterialGraphProject/Assets/Matt/UnlitMasterNode.cs
  2. 12
      MaterialGraphProject/Assets/Matt/UnlitMasterNode.cs.meta

63
MaterialGraphProject/Assets/Matt/UnlitMasterNode.cs


using System;
using UnityEngine.Graphing;
namespace UnityEngine.MaterialGraph
{
[Serializable]
[Title("Master/Unlit")]
public class UnlitMasterNode : AbstractAdvancedMasterNode
{
public const string LightFunctionName = "Advanced";
public const string SurfaceOutputStructureName = "SurfaceOutputAdvanced";
public UnlitMasterNode()
{
name = "UnlitMaster";
UpdateNodeAfterDeserialization();
}
public override string GetMaterialID()
{
return "SHADINGMODELID_UNLIT";
}
public override int[] GetCustomDataSlots()
{
return new int[] { };
}
public override string[] GetCustomData()
{
return new string[] { };
}
public sealed override void UpdateNodeAfterDeserialization()
{
AddSlot(new MaterialSlot(AlbedoSlotId, AlbedoSlotName, AlbedoSlotName, SlotType.Input, SlotValueType.Vector3, Vector4.zero));
AddSlot(new MaterialSlot(NormalSlotId, NormalSlotName, NormalSlotName, SlotType.Input, SlotValueType.Vector3, Vector4.zero));
AddSlot(new MaterialSlot(EmissionSlotId, EmissionSlotName, EmissionSlotName, SlotType.Input, SlotValueType.Vector3, Vector4.zero));
AddSlot(new MaterialSlot(AlphaSlotId, AlphaSlotName, AlphaSlotName, SlotType.Input, SlotValueType.Vector1, Vector4.zero));
// clear out slot names that do not match the slots
// we support
RemoveSlotsNameNotMatching(
new[]
{
AlbedoSlotId,
NormalSlotId,
EmissionSlotId,
AlphaSlotId
});
}
public override string GetSurfaceOutputName()
{
return SurfaceOutputStructureName;
}
public override string GetLightFunction()
{
return LightFunctionName;
}
}
}

12
MaterialGraphProject/Assets/Matt/UnlitMasterNode.cs.meta


fileFormatVersion: 2
guid: ea393384786555042850882db80a89d9
timeCreated: 1478188276
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存