|
|
|
|
|
|
{ |
|
|
|
return SlotValueType.Vector4; |
|
|
|
} |
|
|
|
if (t == typeof(Color)) |
|
|
|
{ |
|
|
|
return SlotValueType.Vector4; |
|
|
|
} |
|
|
|
if (t == typeof(Texture2D)) |
|
|
|
{ |
|
|
|
return SlotValueType.Texture2D; |
|
|
|
|
|
|
var attribute = GetSlotAttribute(par); |
|
|
|
|
|
|
|
MaterialSlot s; |
|
|
|
if (attribute.binding == Binding.None || par.IsOut) |
|
|
|
{ |
|
|
|
if (attribute.binding == Binding.None && !par.IsOut && par.ParameterType == typeof(Color)) |
|
|
|
s = new ColorMaterialSlot(attribute.slotId, par.Name, par.Name, SlotType.Input, attribute.defaultValue ?? Vector4.zero, hidden: attribute.hidden); |
|
|
|
else if (attribute.binding == Binding.None || par.IsOut) |
|
|
|
ConvertTypeToSlotValueType(par), |
|
|
|
attribute.slotId, |
|
|
|
par.Name, |
|
|
|
par.Name, |
|
|
|
par.IsOut ? SlotType.Output : SlotType.Input, |
|
|
|
attribute.defaultValue ?? Vector4.zero, |
|
|
|
hidden: attribute.hidden); |
|
|
|
} |
|
|
|
ConvertTypeToSlotValueType(par), |
|
|
|
attribute.slotId, |
|
|
|
par.Name, |
|
|
|
par.Name, |
|
|
|
par.IsOut ? SlotType.Output : SlotType.Input, |
|
|
|
attribute.defaultValue ?? Vector4.zero, |
|
|
|
hidden: attribute.hidden); |
|
|
|
{ |
|
|
|
} |
|
|
|
slots.Add(s); |
|
|
|
|
|
|
|
m_Slots.Add(attribute); |
|
|
|