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