private static string GetFieldType(FieldInfo field, out int componentCount) { string fieldType; object[] overrideType = field.GetCustomAttributes(typeof(OverrideType), false); if (overrideType.Length > 0) { OverrideType first = (OverrideType)overrideType[0]; fieldType = first.typeName; componentCount = 0; } else { // TODO: handle non-float types componentCount = GetComponentCount(field.FieldType.Name); switch (GetBaseFieldType(field.FieldType.Name)) { case BaseFieldType.Float: fieldType = vectorTypeNames[componentCount]; break; case BaseFieldType.Uint: fieldType = uintTypeNames[componentCount]; break; default: fieldType = "unknown"; break; } } return(fieldType); }
private static string GetFieldType(FieldInfo field, out int floatVectorCount) { string fieldType; object[] overrideType = field.GetCustomAttributes(typeof(OverrideType), false); if (overrideType.Length > 0) { OverrideType first = (OverrideType)overrideType[0]; fieldType = first.typeName; floatVectorCount = 0; } else { // TODO: handle non-float types floatVectorCount = GetFloatVectorCount(field.FieldType.Name); fieldType = vectorTypeNames[floatVectorCount]; } return(fieldType); }