Exemple #1
0
    void ReadCopyList()
    {
        string target_file = PublicClass.filePath + "filelist.txt";

        StartCoroutine((Vesal_DirFiles.Vesal_FileCopy(PublicClass.fileLocalStreamingPath + "filelist.txt", target_file, () => {
            copy_list.AddRange(Vesal_DirFiles.ReadFileWithLine(target_file));
            DebugLog.DebugLogInfo("copy_list count -----------------:" + copy_list.Count);
            PublicClass.DataManagerStatus = DataIntState.Init;
            Vesal_DirFiles.DelFile(target_file);
        })));
    }
Exemple #2
0
    public void PreAssets()
    {
        DebugLog.DebugLogInfo("preasset---------------------------------");

        PublicClass.DataManagerStatus = DataIntState.StreamCopying;

        string source_path = string.Empty;

#if UNITY_EDITOR || UNITY_STANDALONE_WIN
        source_path = PublicClass.fileLocalStreamingPath.Replace("file://", "");
#elif UNITY_IOS
        source_path = PublicClass.fileLocalStreamingPath;
#elif UNITY_ANDROID
        source_path = PublicClass.fileLocalStreamingPath;
#endif
        string target_path = PublicClass.filePath;
        try
        {
            Vesal_DirFiles.DelectDirFiles(target_path, new List <string> {
                "PPT", "temp"
            });
            DebugLog.DebugLogInfo("delete files ok---------------------------------");
            UnityEngine.Debug.Log(source_path);
            UnityEngine.Debug.Log(copy_list.Count);
            PublicClass.InitDirFiles();

            stream_copy_list = PublicTools.DeepCopy <List <string> >(copy_list);
            for (int i = 0; i < stream_copy_list.Count; i++)
            {
                stream_copy_list[i] = source_path + stream_copy_list[i];
            }
            if (copy_list.Count > 0)
            {
                string source = stream_copy_list[stream_copy_count];
                string target = target_path + copy_list[stream_copy_count];
                StartCoroutine(Vesal_DirFiles.Vesal_FileCopy(source, target, count_stream_copy));
            }
            else
            {
                DebugLog.DebugLogInfo("stream copy 异常--------------------------------");

                PublicClass.DataManagerStatus = DataIntState.FetchDb;
            }
        }
        catch (Exception e)
        {
            UnityEngine.Debug.Log("current count :" + stream_copy_count);
            UnityEngine.Debug.Log(e.Message);
            UnityEngine.Debug.Log(e.StackTrace);
            PublicClass.DataManagerStatus = DataIntState.FetchDb;
        }
    }
Exemple #3
0
    void count_stream_copy()
    {
        stream_copy_count++;
        if (stream_copy_count >= stream_copy_list.Count)
        {
            PublicClass.DataManagerStatus = DataIntState.FetchDb;
            PublicTools.save_version_to_file(PublicClass.filePath + "version.dat", PublicClass.get_assets_version());
        }
        else
        {
            string source = stream_copy_list[stream_copy_count];
            string target = PublicClass.filePath + copy_list[stream_copy_count];

            StartCoroutine((Vesal_DirFiles.Vesal_FileCopy(source, target, count_stream_copy)));
        }
    }