fixing and tweaking stuff

This commit is contained in:
Daniel Tyomin
2024-08-20 11:39:32 +02:00
parent 7764a0e697
commit f78ac78893
10 changed files with 353 additions and 53 deletions

View File

@@ -198,11 +198,24 @@ public class Scoreboard: MonoBehaviour
{
if (ProductCounts.ContainsKey(quota.Type))
{
if (quota.Quantity <= TotalCount(quota.Type))
{
sb.Append("<color=green>");
}
else
{
sb.Append("<color=red>");
}
sb.Append($"{quota.Type.name}: {TotalCount(quota.Type)}/{quota.Quantity}\n");
sb.Append("</color>");
}
else
{
sb.Append("<color=red>");
sb.Append($"{quota.Type.name}: 0/{quota.Quantity}\n");
sb.Append("</color>");
}
}
@@ -233,14 +246,17 @@ public class Scoreboard: MonoBehaviour
sb.Append($"{quota.Type.name}: {TotalCount(quota.Type)}/{quota.Quantity}\n");
sb.Append("\n");
sb.Append($"Overall {quota.Type.name} defect percentage: {DefectPercentage(quota.Type)}%\n");
if (quota.MaxDefectivePercentage < DefectPercentage(quota.Type))
{
success = false;
sb.Append($"Too many of {quota.Type.name} were defective!\n");
break;
}
sb.Append($"Overall {quota.Type.name} defect percentage: {DefectPercentage(quota.Type)}%\n");
sb.Append("\n");
}
sb.Append(success ? CurrentObjective.SuccessMessage : CurrentObjective.FailureMessage);

View File

@@ -171,7 +171,13 @@ public class UIManager: MonoBehaviour
break;
case UIState.Game:
AudioListener.pause = false;
#if UNITY_EDITOR
Time.timeScale = 1f;
#else
Time.timeScale = 1f;
#endif
Cursor.lockState = CursorLockMode.Locked;
Reticle.SetActive(true);
break;
@@ -289,10 +295,10 @@ public class UIManager: MonoBehaviour
switch (Scoreboard.Instance.CurrentStage)
{
case StagingManager.StageEnum.Level1:
StartStage(1);
StartStage(2);
break;
case StagingManager.StageEnum.Level2:
StartStage(2);
StartStage(4);
break;
case StagingManager.StageEnum.Level3:
break;