| | |
| | | }
|
| | |
|
| | | float timer = 0f;
|
| | | float originalExpectTotalTime = 0f;
|
| | | float progressRateOfIncrease = 1f;
|
| | | float originalExpectTotalTime = -1f;
|
| | | float expectTotalTime = 0f;
|
| | | public float totalTime {
|
| | | get {
|
| | |
| | | else
|
| | | {
|
| | | timer += Time.deltaTime;
|
| | | var progress = Mathf.Lerp(progressInfo.totalProgress, timer / totalTime, 0.5f);
|
| | | var progress = progressInfo.totalProgress + progressRateOfIncrease * Time.deltaTime / totalTime;
|
| | |
|
| | | var partProgress = 0f;
|
| | | if (currentTask == null)
|
| | |
| | | }
|
| | |
|
| | | expectTotalTime = time;
|
| | | if (originalExpectTotalTime <= 0f)
|
| | | {
|
| | | originalExpectTotalTime = expectTotalTime;
|
| | | }
|
| | |
|
| | | progressRateOfIncrease = (expectTotalTime - timer) / (originalExpectTotalTime - timer);
|
| | | }
|
| | |
|
| | | public enum LaunchStage
|
| | |
| | | public float progress { get; protected set; }
|
| | | public virtual float expectTime { get; protected set; }
|
| | |
|
| | | protected float outTime = 15f;
|
| | |
|
| | | public abstract void Begin();
|
| | | public abstract void Update();
|
| | | public abstract void End();
|
| | |
|
| | | public void ExceptionReport()
|
| | | {
|
| | | if (!exceptionReported && timer > 15f && !done)
|
| | | if (!exceptionReported && timer > outTime && !done)
|
| | | {
|
| | | var content = string.Format("任务:{0};网络状态:{1}", this.GetType().Name, Application.internetReachability);
|
| | | ExceptionCatcher.ReportException("游戏启动执行失败!", content);
|
| | | ExceptionCatcher.ReportException("游戏启动执行超时!", content);
|
| | | exceptionReported = true;
|
| | | }
|
| | | }
|
| | |
| | | public class SDKInitedTask : LaunchTask
|
| | | {
|
| | | public override float expectTime {
|
| | | get { return LocalSave.GetFloat("SDKInitedTask_ExpectTime", 0.5f); }
|
| | | get { return LocalSave.GetFloat("SDKInitedTask_ExpectTime", 1f); }
|
| | | protected set { LocalSave.SetFloat("SDKInitedTask_ExpectTime", value); }
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | m_CurrentStage = LaunchStage.AssetCopy;
|
| | | duration = Mathf.Max(0.1f, expectTime);
|
| | |
|
| | | outTime = 50f;
|
| | | #if UNITY_ANDROID
|
| | | switch (VersionConfig.Get().assetAccess)
|
| | | {
|
| | |
| | | public class AssetBundleInitTask : LaunchTask
|
| | | {
|
| | | public override float expectTime {
|
| | | get { return LocalSave.GetFloat("AssetBundleInitTask_ExpectTime", 0.5f); }
|
| | | get { return LocalSave.GetFloat("AssetBundleInitTask_ExpectTime", 1f); }
|
| | | protected set { LocalSave.SetFloat("AssetBundleInitTask_ExpectTime", value); }
|
| | | }
|
| | |
|