Exemplo n.º 1
0
    public static void SplitByte()
    {
        PublicClass.InitStaticData();
        string        db_path  = PublicClass.filePath + "Mediacl/RA0901001_1/";
        List <string> namelist = new List <string>();

        namelist.AddRange(Vesal_DirFiles.GetAllDirInfoFromPath(db_path));
        Debug.Log(db_path);
        for (int i = 0; i < namelist.Count; i++)
        {
            Debug.Log(namelist[i]);
            Vesal_DirFiles.SaveAbfile(namelist[i], PublicClass.filePath + Vesal_DirFiles.get_file_name_from_full_path(namelist[i]), false, false);
        }
    }
Exemplo n.º 2
0
    public bool abfile_process()
    {
        vesal_log.vesal_write_log("--ab file start  ");

        thread = new Thread(delegate()
        {
            vesal_log.vesal_write_log("-- ab ss");
            Vesal_DirFiles.SaveAbfile(temppath, savepath, false);
            vesal_log.vesal_write_log("-- ab end");
            if (succes_method != null)
            {
                succes_method();
            }
        });
        //开启子线程
        thread.IsBackground = true;
        thread.Start();
        vesal_log.vesal_write_log("-- ab thread started");

        return(true);
    }
Exemplo n.º 3
0
    IEnumerator update_db_process()
    {
        string fixdb = PublicClass.MedicalPath + "vesali.db";
        string tmpdb = PublicClass.vesal_db_path + "temp.db";

        Vesal_DirFiles.DelFile(tmpdb);
        if (File.Exists(fixdb))
        {
            File.Move(fixdb, tmpdb);
        }
        show_progress.current_progress = 0.03f;
        string[] fname = Directory.GetFiles(PublicClass.MedicalPath);
        foreach (string file in fname)
        {
            string name   = Vesal_DirFiles.get_file_name_from_full_path(file);
            string suffix = Vesal_DirFiles.get_name_suffix(name);
            if (suffix.ToLower() == "assetbundle")
            {
                Vesal_DirFiles.DelFile(PublicClass.filePath + name);
                Vesal_DirFiles.SaveAbfile(file, PublicClass.filePath + name, false);
                Vesal_DirFiles.DelFile(file);
            }
        }

        show_progress.current_progress = 0.1f;
        //        string tmpdb = PublicClass.vesal_db_path + "temp.db";
        //打开数据库进行更新
        List <string> fix_tab_list = new List <string>();

        if (File.Exists(tmpdb))
        {
            fix_tab_list = PublicTools.get_table_list("temp.db");
            if (fix_tab_list.Count != 0)
            {
                int tab_count = 0;
                foreach (string tab_name in fix_tab_list)
                {
                    switch (tab_name)
                    {
                    case "GetSubModel":
                        PublicTools.update_GetSubModel_db("temp.db");
                        break;

                    case "GetStructList":
                        PublicTools.update_GetStructList_db("temp.db");
                        break;

                    case "GetStructAbList":
                        PublicTools.update_GetStructAbList_db("temp.db");
                        break;

                    case "LayserSubModel":
                        PublicTools.update_LayserSubModel_db("temp.db");
                        break;

                    case "ModelRelationModel":
                        PublicTools.update_ModelRelationModel_db("temp.db");
                        break;

                    case "RightMenuLayerModel":
                        PublicTools.update_RightMenuLayerModel_db("temp.db");
                        break;

                    case "RightMenuModel":
                        PublicTools.update_RightMenuModel_db("temp.db");
                        break;

                    case "SignNewInfo":
                        PublicTools.update_SignNewInfo_db("temp.db");
                        break;

                    case "GetTextureModelList":
                        PublicTools.update_GetTextureModelList_db("temp.db");
                        break;

                    case "noun_no_info":
                        PublicTools.update_noun_no_info_db("temp.db");
                        break;

                    case "AbInfo":
                        PublicTools.update_ab_info_db("temp.db");
                        break;
                    }
                    tab_count++;
                    show_progress.current_progress = 0.1f + 0.9f * tab_count / fix_tab_list.Count;
                    yield return(null);
                }
            }
            else
            {
                PublicTools.update_GetSubModel_db("temp.db");
                PublicTools.update_GetStructList_db("temp.db");
                show_progress.current_progress = 0.35f;
                yield return(null);

                PublicTools.update_GetStructAbList_db("temp.db");
                PublicTools.update_LayserSubModel_db("temp.db");
                show_progress.current_progress = 0.5f;
                yield return(null);

                PublicTools.update_ModelRelationModel_db("temp.db");
                PublicTools.update_RightMenuLayerModel_db("temp.db");
                show_progress.current_progress = 0.7f;
                yield return(null);

                PublicTools.update_RightMenuModel_db("temp.db");
                PublicTools.update_SignNewInfo_db("temp.db");
                show_progress.current_progress = 0.85f;
                yield return(null);

                PublicTools.update_GetTextureModelList_db("temp.db");
                PublicTools.update_noun_no_info_db("temp.db");
                PublicTools.update_ab_info_db("temp.db");
                show_progress.current_progress = 0.99f;
                yield return(null);
            }
            Vesal_DirFiles.DelFile(tmpdb);
            PublicTools.Model_AB_dic_update();
            ManageModel.Instance.UpdateModelInfo();
        }
        OperaStatus = AppOperState.Apprun;
    }