Fix startup progress bar.
This commit is contained in:
@@ -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.
Reference in New Issue
Block a user