Ejemplo n.º 1
0
    public static void UpdateInstantUpdateConfig(this MonoBehaviour mono, List <string> gameModuleList, System.Action <string, JSONObject> onComplete)
    {
        string src = Constants.DownloadPath; // + Constants.Config_File;
        string des = Constants.DataPath;     // + Constants.Config_File;
        //System.Action<string, long, long> onProcess = null;
        bool isUpdate = false;

        mono.CompareConfig(src, des, gameModuleList, isUpdate, (config, srcReservedConfig, error) =>
        {
            if (error != null)
            {
                if (onComplete != null)
                {
                    onComplete(error, null);
                }
            }
            else
            {
                //mono.UpdateFiles(src, des, config, srcReservedConfig, isUpdate, onProcess, onComplete);
                UpdateConfig(des, config, srcReservedConfig);
                if (onComplete != null)
                {
                    onComplete(null, config);
                }
            }
        });
    }
Ejemplo n.º 2
0
 public static void UpdateGameModules(this MonoBehaviour mono, string src, string des, List <string> gameModuleList, bool isUpdate, System.Action <string, long, long> onProcess, System.Action <string, JSONObject> onComplete)
 {
     mono.CompareConfig(src, des, gameModuleList, isUpdate, (config, srcReservedConfig, error) =>
     {
         if (error != null)
         {
             if (onComplete != null)
             {
                 onComplete(error, null);
             }
         }
         else
         {
             mono.UpdateFiles(src, des, config, srcReservedConfig, isUpdate, onProcess, onComplete);
         }
     });
 }