public void DownLoad(string url, string filePath, System.Action <float> callBack = null, bool isBreakPoint = false) { if (isBreakPoint) { mDownLoadBreakPoint.SetRangeEnd(true).DownLoad(url, filePath, callBack); } else { mDownLoadCommon.SetRangeEnd(true).DownLoad(url, filePath, (progress) => { if (progress == DownLoadCommon.ErrorCode_DownLoadFail || progress == DownLoadCommon.ErrorCode_DownLoadStop) { Service_File serviceFile = GameServiceContext.GetService <Service_File>(); serviceFile.DeleteFile(filePath); } if (callBack != null) { callBack(progress); } }); } }
private static T GetSetGameService <T>() where T : IGameService, new() { bool result = GameServiceContext.RegisterService <T>(); return(result ? GameServiceContext.GetService <T>() : default(T)); }