少年修仙传客户端代码仓库
client_Wu Xijin
2019-01-23 df3886bb6f56b653222d11b59da2767d7a731c17
5971  双进度条表现逻辑
1个文件已修改
23 ■■■■■ 已修改文件
Core/GameEngine/Login/Launch.cs 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/Login/Launch.cs
@@ -123,7 +123,8 @@
    }
    float timer = 0f;
    float originalExpectTotalTime = 0f;
    float progressRateOfIncrease = 1f;
    float originalExpectTotalTime = -1f;
    float expectTotalTime = 0f;
    public float totalTime {
        get {
@@ -220,7 +221,7 @@
            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)
@@ -255,6 +256,12 @@
        }
        expectTotalTime = time;
        if (originalExpectTotalTime <= 0f)
        {
            originalExpectTotalTime = expectTotalTime;
        }
        progressRateOfIncrease = (expectTotalTime - timer) / (originalExpectTotalTime - timer);
    }
    public enum LaunchStage
@@ -280,16 +287,18 @@
        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;
            }
        }
@@ -299,7 +308,7 @@
    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); }
        }
@@ -361,7 +370,7 @@
        {
            m_CurrentStage = LaunchStage.AssetCopy;
            duration = Mathf.Max(0.1f, expectTime);
            outTime = 50f;
#if UNITY_ANDROID
            switch (VersionConfig.Get().assetAccess)
            {
@@ -745,7 +754,7 @@
    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); }
        }