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

Binary file not shown.