public bool[] GetBoolArray(string key) { try { if (this.ContainsKey(key)) { return(ParseTool.String2BoolArray(this[key])); } if (data.m_defaultValue.ContainsKey(key)) { return(ParseTool.String2BoolArray(data.m_defaultValue[key])); } } catch (Exception e) { throw new Exception("SingleData GetBoolArray Error TableName is :->" + data.m_tableName + "<- key :->" + key + "<- singleDataName : ->" + m_SingleDataKey + "<- \n" + e.ToString()); } throw new Exception("Don't Exist Value or DefaultValue by ->" + key + "<- TableName is : ->" + data.m_tableName + "<- singleDataName : ->" + m_SingleDataKey + "<-"); // throw }
public static object TableString2ObjectValue(string v, FieldType fieldValueType, string enumType) { object t = null; switch (fieldValueType) { case FieldType.String: t = v; break; case FieldType.Bool: t = bool.Parse(v); break; case FieldType.Int: t = int.Parse(v); break; case FieldType.Float: t = float.Parse(v); break; case FieldType.Vector2: t = ParseTool.String2Vector2(v); break; case FieldType.Vector3: t = ParseTool.String2Vector3(v); break; case FieldType.Color: t = ParseTool.String2Color(v); break; case FieldType.Enum: Type type = ConfigFieldValueType2Type(fieldValueType, enumType); t = Enum.Parse(type, v); break; case FieldType.StringArray: t = ParseTool.String2StringArray(v); break; case FieldType.IntArray: t = ParseTool.String2IntArray(v); break; case FieldType.FloatArray: t = ParseTool.String2FloatArray(v); break; case FieldType.BoolArray: t = ParseTool.String2BoolArray(v); break; case FieldType.Vector2Array: t = ParseTool.String2Vector2(v); break; case FieldType.Vector3Array: t = ParseTool.String2Vector3Array(v); break; default: break; } return(t); }