Fix startup progress bar.

This commit is contained in:
2022-10-01 16:24:50 +08:00
parent b57d6d2e0f
commit 5903264830
2 changed files with 2 additions and 2 deletions

View File

@@ -14,7 +14,7 @@ namespace Cryville.Crtr {
#pragma warning restore IDE0044
bool initialized = false;
int totalTasks = -1;
int totalTasks = 0;
#pragma warning disable IDE0051
void Awake() {
Game.Init();
@@ -23,7 +23,7 @@ namespace Cryville.Crtr {
void Update() {
if (!initialized) {
int taskCount = Game.NetworkTaskWorker.TaskCount;
if (totalTasks == -1) totalTasks = taskCount;
if (totalTasks < taskCount) totalTasks = taskCount;
m_progressBar.value = 1 - (float)taskCount / totalTasks;
if (taskCount == 0) {
initialized = true;

Binary file not shown.