diff --git a/Assets/ManagedResources/UpdatePanel/UpdatePanel.prefab b/Assets/ManagedResources/UpdatePanel/UpdatePanel.prefab index d1ae969402..7432ac5f5e 100644 --- a/Assets/ManagedResources/UpdatePanel/UpdatePanel.prefab +++ b/Assets/ManagedResources/UpdatePanel/UpdatePanel.prefab @@ -2212,4 +2212,4 @@ MonoBehaviour: m_HorizontalOverflow: 1 m_VerticalOverflow: 1 m_LineSpacing: 1 - m_Text: 56% + m_Text: diff --git a/Assets/Scripts/GameInit/UpdatePanel.cs b/Assets/Scripts/GameInit/UpdatePanel.cs index 236a687e78..404a57e30d 100644 --- a/Assets/Scripts/GameInit/UpdatePanel.cs +++ b/Assets/Scripts/GameInit/UpdatePanel.cs @@ -292,7 +292,7 @@ namespace GameLogic void OnResUpdateProgress(ResUpdateProgress progress) { slider.UpdateValue(progress.Progress); - tipsText.text = string.Format("下载进度:{0}/{1}MB({2}%)", progress.SizeMB, progress.TotalSizeMB, (progress.SizeMB/progress.TotalSizeMB)*100); + tipsText.text = string.Format("下载进度:{0}/{1}MB({2}%)", progress.SizeMB.ToString("f2"), progress.TotalSizeMB.ToString("f2"), ((progress.SizeMB/progress.TotalSizeMB)*100).ToString("f2")); } /// diff --git a/Assets/Scripts/UI/SliderCtrl.cs b/Assets/Scripts/UI/SliderCtrl.cs index 4473e0f414..4c8668840e 100644 --- a/Assets/Scripts/UI/SliderCtrl.cs +++ b/Assets/Scripts/UI/SliderCtrl.cs @@ -45,7 +45,9 @@ namespace GameLogic { if (Mathf.Abs(slider.value - cur) < 0.005) return; - slider.value = Mathf.Lerp(slider.value, cur, Time.deltaTime * 5); + float fv = Mathf.Lerp(slider.value, cur, Time.deltaTime * 5); + slider.value = fv; + progress.text = Mathf.Floor(fv * 100) + "%"; } } }