APPVersion getLocal()
 {
     if (System.IO.File.Exists(appConfigPath_old + "/" + appversion_config))
     {
         return(APPVersion.FromStr(FileUtil.ReadFromFile(appConfigPath_old + "/" + appversion_config)));
     }
     return(APPVersion.FromStr(FileUtil.ReadFromFile(Application.streamingAssetsPath + "/appVersion.con")));
 }
    /// <summary>
    /// 根据配置信息更新
    /// </summary>
    void compareAndUpdate()
    {
        APPVersion appnew = APPVersion.FromStr(FileUtil.ReadFromFile(appConfigPath_new + "/" + appversion_config));
        APPVersion appold = getLocal();

        string[] up = appnew.GetUpdateResult(appold);
        if (up != null)
        {
            for (int i = 0; i < up.Length; i++)
            {
                updateDll(up[i]);
            }
        }
        updateABRes(getUpdatelist());
    }
示例#3
0
    public static APPVersion FromStr(string str)
    {
        APPVersion ver = new APPVersion();

        string[] strs = str.Split('|');
        for (int i = 0; i < strs.Length; i++)
        {
            if (strs[i] == "")
            {
                continue;
            }
            GameVersion g = GameVersion.FromStr(strs[i]);
            ver.gamelist.Add(g);
        }
        return(ver);
    }
示例#4
0
    void initAppConfig()
    {
        string[]   gs  = System.Enum.GetNames(typeof(GameEnum));
        APPVersion app = new APPVersion();

        //AssetConfig
        for (int i = 0; i < gs.Length; i++)
        {
            GameVersion ver = new GameVersion(gs[i], "name:" + gs[i]);
            app.Add(ver);
            AssetVersion aver = new AssetVersion();
            aver.assetVersion = 0;
            AssetbundleConfig abcon = new AssetbundleConfig();
            abcon.AddAssetBundle("test", "has001");
            PreloadConfig pre = new PreloadConfig();

            FileUtil.SaveFile(path + "/" + gs[i] + "/assetVersion.config", aver.ToStr());
            FileUtil.SaveFile(path + "/" + gs[i] + "/abConfig.config", abcon.ToString());
            FileUtil.SaveFile(path + "/" + gs[i] + "/preloadConfig.config", pre.ToString());
        }
        FileUtil.SaveFile(path + "/appVersion.config", app.ToString());                   //appversion
    }
示例#5
0
 public string[] GetUpdateResult(APPVersion old)
 {
     return(null);
 }