//后台下载,用于边玩边下(空闲自动下载,随时启动,优先级比前台低 public AssetDownloadCentral GetBackgroundCentral() { if (m_backgroundCentral == null) { GameObject centralGobj = new GameObject("BackgroundCentral"); centralGobj.transform.SetParent(GetCentralGameObject().transform, false); m_backgroundCentral = centralGobj.AddComponent <AssetDownloadCentral>(); } return(m_backgroundCentral); }
public void StopByManager(AssetDownloadCentral central) { if (m_downloadMgr == null) { return; } m_downloadMgr.StopDown(true, false); StartTime = -1; status = AssetDownloadStatus.DOWNLOAD_CANCELED; }
public void ResumeByManager(AssetDownloadCentral central) { if (m_downloadMgr == null) { return; } m_downloadMgr.ResumeDown(); StartTime = XTimeTools.NowTimeStampMs; status = AssetDownloadStatus.DOWNLOAD_DOWNLOADING; }
public void PauseByManager(AssetDownloadCentral central) { if (m_downloadMgr == null) { return; } m_downloadMgr.PauseDown(); StartTime = -1; status = AssetDownloadStatus.DOWNLOAD_PAUSE; }
//////// public void StartByManager(AssetDownloadCentral central) { var mgr = GetDownloadMgr(); mgr.OnDownloadFinish = OnFinish; mgr.OnDownloadProgress = OnProgress; mgr.StartDown(urlPaths, savePaths, downThreadNumb, limitDownSize); StartTime = XTimeTools.NowTimeStampMs; status = AssetDownloadStatus.DOWNLOAD_DOWNLOADING; }
public AssetDownloadTask(AssetDownloadCentral central) { m_central = central; CreateTime = XTimeTools.NowTimeStampMs; status = AssetDownloadStatus.DOWNLOAD_NONE; }