Exemplo n.º 1
0
 //-------------------------------------------------------------------------
 public void cloneData(ProjectPlatformInfo project_info)
 {
     this.PlatformKey            = project_info.PlatformKey;
     this.PlatformName           = project_info.PlatformName;
     this.BundleVersion          = project_info.BundleVersion;
     this.DataVersion            = project_info.DataVersion;
     this.PlatformTargetRootPath = project_info.PlatformTargetRootPath;
     this.BuildTarget            = project_info.BuildTarget;
     this.IsBuildPlatform        = project_info.IsBuildPlatform;
 }
Exemplo n.º 2
0
    //-------------------------------------------------------------------------
    public static void changeDataData(_ePlatform platform, string target_path, string new_data, bool change_allplatform = false)
    {
        string        ab_pathinfo = target_path + "/" + PatchInfoName;
        var           infos       = File.ReadAllLines(ab_pathinfo);
        StringBuilder sb          = new StringBuilder();

        for (int i = 0; i < infos.Length; i++)
        {
            var line = infos[i];
            if (change_allplatform)
            {
                string data = "DataVersion=\"";
                if (line.Contains(data))
                {
                    string replace_oldvalue = line.Substring(line.IndexOf(data), 22);
                    string replace_newvalue = "DataVersion=\"" + new_data + "\"";
                    line = line.Replace(replace_oldvalue, replace_newvalue);
                }
            }
            else
            {
                if (line.Contains(platform.ToString()))
                {
                    string replace_oldvalue = line.Substring(line.IndexOf("DataVersion=\""), 22);
                    string replace_newvalue = "DataVersion=\"" + new_data + "\"";
                    line = line.Replace(replace_oldvalue, replace_newvalue);
                }
            }

            sb.AppendLine(line);
        }

        using (StreamWriter sw = new StreamWriter(ab_pathinfo))
        {
            sw.Write(sb.ToString());
        }
    }