Example #1
0
 public static object InnerStructFromString(Type type, string value)
 {
     if (type == typeof(ColorBlock))
     {
         return(ParamAnalysisTool.StringToColorBlock(value));
     }
     if (type == typeof(Color))
     {
         return(ParamAnalysisTool.StringToColor(value));
     }
     else if (type == typeof(Vector2))
     {
         return(ParamAnalysisTool.StringToVector2(value));
     }
     else if (type == typeof(Vector2Int))
     {
         return(ParamAnalysisTool.StringToVector2Int(value));
     }
     else if (type == typeof(Vector3))
     {
         return(ParamAnalysisTool.StringToVector3(value));
     }
     else if (type == typeof(Vector3Int))
     {
         return(ParamAnalysisTool.StringToVector3Int(value));
     }
     else if (type == typeof(Vector4))
     {
         return(ParamAnalysisTool.StringToVector4(value));
     }
     else if (type == typeof(Rect))
     {
         return(ParamAnalysisTool.StringToRect(value));
     }
     Debug.LogWarningFormat("未成功解析类型为{0}的信息", type.FullName);
     return(null);
 }