/// <summary> /// 将字段类型(FieldType)转换为对应 数据类型(Type) /// </summary> /// <param name="fieldValueType"></param> /// <param name="enumType"></param> /// <returns></returns> public static Type ConfigFieldValueType2Type(FieldType fieldValueType, string enumType, List <char> arraySplitFormat) { Type t = null; switch (fieldValueType) { case FieldType.String: t = typeof(string); break; case FieldType.Bool: t = typeof(bool); break; case FieldType.Int: t = typeof(int); break; case FieldType.Float: t = typeof(float); break; case FieldType.Vector2: t = typeof(Vector2); break; case FieldType.Vector3: t = typeof(Vector3); break; case FieldType.Color: t = typeof(Color); break; case FieldType.Enum: t = ReflectionUtils.GetTypeByTypeFullName(enumType); break; case FieldType.StringArray: t = ParseTool.CreateInterleavedType(typeof(string), arraySplitFormat.Count + 1); // t = typeof(string[]); break; case FieldType.IntArray: // t = typeof(int[]); t = ParseTool.CreateInterleavedType(typeof(int), arraySplitFormat.Count + 1); break; case FieldType.FloatArray: // t = typeof(float[]); t = ParseTool.CreateInterleavedType(typeof(float), arraySplitFormat.Count + 1); break; case FieldType.BoolArray: // t = typeof(bool[]); t = ParseTool.CreateInterleavedType(typeof(bool), arraySplitFormat.Count + 1); break; case FieldType.Vector2Array: // t = typeof(Vector2[]); t = ParseTool.CreateInterleavedType(typeof(Vector2), arraySplitFormat.Count + 1); break; case FieldType.Vector3Array: // t = typeof(Vector3[]); t = ParseTool.CreateInterleavedType(typeof(Vector3), arraySplitFormat.Count + 1); break; default: break; } return(t); }