public override void Update(ILoadJob job, JobEngine engine) { if (job == null) { engine.SetState(EngineStatus.Wait); return; } // キャンセル時 if (job.IsCanceled || job.IsDisposed) { engine.Refresh(); engine.SetState(EngineStatus.Wait); return; } job.Update(); // エラー if (job.IsError) { engine.SetState(EngineStatus.Error); return; } // 完了 if (job.IsCompleted) { engine.SetState(EngineStatus.Complete); return; } }
/// <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) )); }
public override void Update(ILoadJob job, JobEngine engine) { if (!engine.MoveNext()) { return; } engine.SetState(EngineStatus.Running); }
//===================================== // 関数 //===================================== public MultiLineJobEngine(int lineCount) { m_engineList = new JobEngine[lineCount]; for (int i = 0; i < m_engineList.Length; i++) { m_engineList[i] = new JobEngine(); } }
public void Dispose() { JobCreator.Dispose(); JobEngine.Dispose(); StorageDatabase = null; LoadDatabase = null; JobCreator = null; JobEngine = null; OnDownloadError = null; OnStartAny = null; OnStopAny = null; }
/// <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) )); }
public bool IsProcessing(string name) { var bundle = LoadDatabase.GetBundleData(name); return(JobEngine.HasRequest(bundle.Identifier)); }
public void Cancel() { JobEngine?.Cancel(); }
/// <summary> /// 更新処理 /// </summary> public void DoUpdate() { JobEngine?.Update(); }
public override void Begin(ILoadJob job, JobEngine engine) { job.Error(); engine.Refresh(); }
public virtual void End(ILoadJob job, JobEngine engine) { }
public virtual void Update(ILoadJob job, JobEngine engine) { }
/// <summary> /// 開始 /// </summary> public virtual void Begin(ILoadJob job, JobEngine engine) { }
public override void Begin(ILoadJob job, JobEngine engine) { job.Run(); }
public override void Update(ILoadJob job, JobEngine engine) { engine.SetState(EngineStatus.Wait); }