浏览代码

Translate field type to correct material graph type (MaterialID is ignored for now)

/scriptablerenderloop-materialgraph
Paul Demeulenaere 8 年前
当前提交
455235b0
共有 1 个文件被更改,包括 22 次插入6 次删除
  1. 28
      Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.cs

28
Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.cs


masterNodeDesc[i].slots = fieldsSurface.Concat(fieldsBuiltIn).Select(field =>
{
var attribute = (SurfaceDataAttributes[])field.GetCustomAttributes(typeof(SurfaceDataAttributes), false);
var valueType = UnityEngine.MaterialGraphInterface.SlotValueType.Dynamic;
var fieldType = field.FieldType;
if (fieldType == typeof(float))
{
valueType = MaterialGraphInterface.SlotValueType.Vector1;
}
else if (fieldType == typeof(Vector2))
{
valueType = MaterialGraphInterface.SlotValueType.Vector2;
}
else if (fieldType == typeof(Vector3))
{
valueType = MaterialGraphInterface.SlotValueType.Vector3;
}
else if (fieldType == typeof(Vector2))
{
valueType = MaterialGraphInterface.SlotValueType.Vector4;
}
valueType = UnityEngine.MaterialGraphInterface.SlotValueType.Vector1 //TODO
};
}).ToArray();
valueType = valueType
};
}).Where(o => o.valueType != MaterialGraphInterface.SlotValueType.Dynamic).ToArray(); //For now, ignore materialID type
masterNodeDesc[i].slots = masterNodeDesc[i].slots.OrderBy(o => o.displayName).ToArray();
return masterNodeDesc;
}
}

正在加载...
取消
保存