public static void ReadConfigAsBin(Type type, string name)
    {
        var    gen = BinarySerializerCodeGenerator.GetGenerator(type);
        string serializerFileName = gen.SerializerFileName(type);

        if (!serializerFileName.StartsWith("Static_"))
        {
            UnityEngine.Debug.LogError("Config type must be static");
            return;
        }

        Type serializer = Type.GetType(serializerFileName + ",Assembly-CSharp");

        if (serializer != null)
        {
            MethodInfo read = serializer.GetMethod("Read", BindingFlags.Public | BindingFlags.Static);
            if (read != null)
            {
                string       path = Path.Combine(FileUtils.binary_config_folder, name + ".conf");
                BinaryReader br   = new BinaryReader(File.Open(path, FileMode.Open));
                byte[]       md5  = br.ReadBytes(16);
                var          same = Md5Utility.Md5Compare(md5, Md5Utility.MD5(configGeneratorMd5(type)));
                if (!same)
                {
                    br.Close();
                    UnityEngine.Debug.LogError("Read binary config error: md5 not the same");
                    return;
                }
                read.Invoke(null, new object[] { br });
                br.Close();
            }
            else
            {
                UnityEngine.Debug.LogError("Generate serializer code first");
            }
        }
        else
        {
            UnityEngine.Debug.LogError("Generate serializer code first");
        }
    }
    public static void WriteConfigAsBin(Type type, string name, string folder)
    {
        var    gen = BinarySerializerCodeGenerator.GetGenerator(type);
        string serializerFileName = gen.SerializerFileName(type);

        if (!serializerFileName.StartsWith("Static_"))
        {
            UnityEngine.Debug.LogError("Config type must be static");
            return;
        }

        byte[] md5 = Md5Utility.MD5(ConfigReader.configGeneratorMd5(type));

        Type serializer = Type.GetType(serializerFileName + ",Assembly-CSharp");

        if (serializer != null)
        {
            MethodInfo write = serializer.GetMethod("Write", BindingFlags.Public | BindingFlags.Static);
            if (write != null)
            {
                string       path = Path.Combine(folder, name + ".conf");
                BinaryWriter bw   = new BinaryWriter(File.Open(path, FileMode.Create));
                bw.Write(md5);
                write.Invoke(null, new object[] { bw });
                bw.Close();
            }
            else
            {
                UnityEngine.Debug.LogError("Generate serializer code first");
            }
        }
        else
        {
            UnityEngine.Debug.LogError("Generate serializer code first");
        }
    }