Some Nice UI
This commit is contained in:
@@ -8,19 +8,18 @@ public class LoseScreenController : MonoBehaviour
|
||||
[SerializeField]private const string LoseSceneName = "Lose";
|
||||
|
||||
private List<PlayerStressController> players;
|
||||
private bool hasLost = false;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
players = FindObjectsOfType<PlayerStressController>().ToList();
|
||||
players = Object.FindObjectsByType<PlayerStressController>(FindObjectsSortMode.None).ToList();
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (hasLost || players.Count == 0)
|
||||
if (players.Count == 0)
|
||||
return;
|
||||
|
||||
if (players.All(p => p.IsPanicking))
|
||||
if (players.All(p => p.isPanicking))
|
||||
{
|
||||
TriggerLose();
|
||||
}
|
||||
@@ -28,7 +27,6 @@ public class LoseScreenController : MonoBehaviour
|
||||
|
||||
void TriggerLose()
|
||||
{
|
||||
hasLost = true;
|
||||
SceneManager.LoadScene(LoseSceneName);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user