Example #1
0
        /// <summary>
        /// ローカルファイルを開く
        /// </summary>
        protected virtual ILoadProcess CreateLocalFileOpenJob(IRuntimeBundleData data)
        {
            if (JobEngine.HasRequest(data.Identifier))
            {
                //	リクエスト済みのモノは完了まで待つ
                return(WaitLoadProcess.Wait(data, (d) => d.IsOnMemory));
            }
            var location = StorageDatabase.GetSaveLocation(data);

            if (!File.Exists(location.FullPath))
            {
                OnError(ChipstarResult.ClientError($"Open File is Not Found. == {data.Identifier} for {location.ToString()}"));
                return(SkipLoadProcess.Create(data));
            }
            var job = JobCreator.OpenLocalBundle(JobEngine, data.Identifier, location, data.Hash, data.Crc);

            return(new LoadProcess <AssetBundle>(
                       AddJob(job),
                       onCompleted: (content) =>
            {
                data.OnMemory(content);
            },
                       onError: code => OnError(code)
                       ));
        }
Example #2
0
        /// <summary>
        /// ダウンロード
        /// </summary>
        protected virtual ILoadProcess CreateDowloadJob(IAccessLocation location, IRuntimeBundleData data)
        {
            if (JobEngine.HasRequest(data.Identifier))
            {
                //	リクエスト済みのモノは無視
                return(SkipLoadProcess.Create(location));
            }
            var localPath = StorageDatabase.GetSaveLocation(data);
            var job       = JobCreator.FileDL(JobEngine, data.Identifier, location, localPath, data.FileSize);

            return(new LoadProcess <FileInfo>(
                       AddJob(job),
                       onCompleted: (info) =>
            {
                //	バージョンを保存
                StorageDatabase.Save(data);
            },
                       onError: code => OnError(code)
                       ));
        }
Example #3
0
        public bool IsProcessing(string name)
        {
            var bundle = LoadDatabase.GetBundleData(name);

            return(JobEngine.HasRequest(bundle.Identifier));
        }