少年修仙传客户端代码仓库
client_Wu Xijin
2019-01-24 22db62b392c7bf674ad1f9b2f239bd763e63a282
5971  双进度条表现逻辑
1个文件已修改
32 ■■■■■ 已修改文件
Core/GameEngine/Login/Launch.cs 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/Login/Launch.cs
@@ -215,7 +215,7 @@
            {
                timer += Time.deltaTime;
                var progress = progressInfo.totalProgress + surplusProgress * (Time.deltaTime / surplusTime);
                progress = Mathf.Clamp(progress, 0, 0.95f);
                progress = Mathf.Clamp(progress, 0, 0.98f);
                var partProgress = 0f;
                if (currentTask == null)
@@ -224,7 +224,7 @@
                }
                else
                {
                    var temp = currentTask.timer / Mathf.Min(1f, currentTask.duration);
                    var temp = currentTask.timer / Mathf.Min(2f, currentTask.duration);
                    partProgress = temp - (int)temp;
                }
@@ -318,7 +318,6 @@
            var memory = 2048;
            DeviceUtility.GetCpuAndMemory(out cpu, out memory);
            DebugEx.LogFormat("获得机器信息:cpu {0}----内存 {1}", cpu, memory);
            GameNotice.OpenGameNotice();
        }
        public override void Update()
@@ -350,14 +349,14 @@
        List<FileInfo> copyTasks = new List<FileInfo>();
        public override float expectTime {
            get { return LocalSave.GetFloat("AssetCopyTask_ExpectTime", 30f); }
            get { return LocalSave.GetFloat("AssetCopyTask_ExpectTime", 70f); }
            protected set { LocalSave.SetFloat("AssetCopyTask_ExpectTime", value); }
        }
        public override void Begin()
        {
            m_CurrentStage = LaunchStage.AssetCopy;
            duration = Mathf.Max(0.1f, expectTime);
            duration = Mathf.Max(0.5f, expectTime);
            outTime = 50f;
#if UNITY_ANDROID
            switch (VersionConfig.Get().assetAccess)
@@ -511,7 +510,7 @@
        public override void Begin()
        {
            m_CurrentStage = LaunchStage.AssetCopy;
            duration = Mathf.Max(0.1f, expectTime);
            duration = Mathf.Max(0.5f, expectTime);
            if (!AssetDeCompressTask.assetDeCompressCompleted)
            {
@@ -561,7 +560,7 @@
        public override void Begin()
        {
            m_CurrentStage = LaunchStage.ClientVersion;
            duration = expectTime;
            duration = Mathf.Max(0.5f, expectTime);
#if UNITY_ANDROID
            if (InGameDownTestUtility.enable || !Application.isEditor)
@@ -628,7 +627,7 @@
        public override void Begin()
        {
            m_CurrentStage = LaunchStage.CheckAsset;
            duration = Mathf.Max(0.1f, expectTime);
            duration = Mathf.Max(0.5f, expectTime);
            ServerListCenter.Instance.RequestJumpUrl();
            OperationLogCollect.Instance.RecordLauchEvent(2);
@@ -650,6 +649,7 @@
        {
            expectTime = timer;
            DebugEx.LogFormat("{0}执行时长:{1};", this.GetType().Name, timer);
            GameNotice.OpenGameNotice();
        }
        public override void Update()
@@ -685,7 +685,7 @@
        {
            m_CurrentStage = LaunchStage.DownLoad;
            duration = Mathf.Max(0.1f, expectTime);
            duration = Mathf.Max(0.5f, expectTime);
            if (VersionUtility.Instance.NeedDownAsset())
            {
                if (!AssetVersionUtility.priorAssetDownLoadDone)
@@ -750,7 +750,7 @@
        {
            m_CurrentStage = LaunchStage.AssetBundleInit;
            duration = Mathf.Max(0.1f, expectTime);
            duration = Mathf.Max(0.5f, expectTime);
            if (!AssetSource.allFromEditor)
            {
                AssetBundleUtility.Instance.Sync_LoadAll("ui/prioritywindow");
@@ -796,19 +796,16 @@
    public class ConfigInitTask : LaunchTask
    {
        public override float expectTime {
            get { return LocalSave.GetFloat("ConfigInitTask_ExpectTime", inferredTime); }
            get { return LocalSave.GetFloat("ConfigInitTask_ExpectTime", 10f); }
            protected set { LocalSave.SetFloat("ConfigInitTask_ExpectTime", value); }
        }
        float threshold = 1f;
        float inferredTime = 3f;
        public override void Begin()
        {
            inferredTime = LocalSave.GetFloat("AssetCopyTask_ExpectTime", 30f) / 30f * 10f;
            m_CurrentStage = LaunchStage.ConfigInit;
            duration = Mathf.Max(0.1f, expectTime);
            duration = Mathf.Max(0.5f, expectTime);
            threshold = Application.platform == RuntimePlatform.WindowsEditor ? 1f : 0.9f;
            LaunchPostProcess.Instance.Begin();
@@ -855,7 +852,7 @@
        public override void Begin()
        {
            m_CurrentStage = LaunchStage.Complete;
            duration = Mathf.Max(0.1f, expectTime);
            duration = Mathf.Max(0.5f, expectTime);
            LuaUtility.Instance.Init();
            CSharpCallLua.Init();
@@ -868,14 +865,13 @@
            {
                launchWin.FadeOut();
            }
            WindowCenter.Instance.Open<LaunchBackGroundWin>(true);
        }
        public override void End()
        {
            expectTime = timer;
            DebugEx.LogFormat("{0}执行时长:{1};", this.GetType().Name, timer);
            WindowCenter.Instance.Open<LaunchBackGroundWin>(true);
            var launchBackGroundWin = WindowCenter.Instance.Get<LaunchBackGroundWin>();
            launchBackGroundWin.transform.SetAsFirstSibling();
        }