public float GetCustomVertexData(VertexDataType vertexDataType, VertAttribute attr) { switch (vertexDataType) { case VertexDataType.VertexColorR: return(GetData(VertexColorR.OutDataType, attr)); case VertexDataType.VertexColorG: return(GetData(VertexColorG.OutDataType, attr)); case VertexDataType.VertexColorB: return(GetData(VertexColorB.OutDataType, attr)); case VertexDataType.VertexColorA: return(GetData(VertexColorA.OutDataType, attr)); case VertexDataType.UV1Z: return(GetData(UV1Z.OutDataType, attr)); case VertexDataType.UV1W: return(GetData(UV1W.OutDataType, attr)); default: throw new ArgumentOutOfRangeException(nameof(vertexDataType), vertexDataType, null); } }
private float GetData(OutDataType outDataType, VertAttribute attr) { switch (outDataType) { case OutDataType.Density: return(attr.Density); case OutDataType.Range: return(Radius); case OutDataType.Random: return(attr.Rand); case OutDataType.VertexPosX: return(attr.VertPos.x); case OutDataType.VertexPosY: return(attr.VertPos.y); case OutDataType.VertexPosZ: return(attr.VertPos.z); case OutDataType.PivotX: return(attr.Pivot.x); case OutDataType.PivotY: return(attr.Pivot.y); case OutDataType.PivotZ: return(attr.Pivot.z); case OutDataType.CustomData1: case OutDataType.CustomData2: default: throw new ArgumentOutOfRangeException(nameof(outDataType), outDataType, null); } }