Add Alot of stuff, Computer, repairStation, Whole game, Many things!
This commit is contained in:
32
Assets/HUD/DayEndHUDController.cs
Normal file
32
Assets/HUD/DayEndHUDController.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
|
||||
public class DayEndHUDController : MonoBehaviour {
|
||||
[SerializeField] private TextMeshProUGUI _gainsText;
|
||||
|
||||
[SerializeField] private TextMeshProUGUI _rentText;
|
||||
[SerializeField] private TextMeshProUGUI _profitText;
|
||||
|
||||
[SerializeField] private TextMeshProUGUI _buttonText;
|
||||
|
||||
public void DayEnd(float gains, float rent, float profit) {
|
||||
_gainsText.text = "Gains: " + gains + "$";
|
||||
_rentText.text = "Rent: " + rent + "$";
|
||||
_profitText.text = "Profit: " + profit + "$";
|
||||
|
||||
//Check if the user is bankrupt
|
||||
if (GameController.Instance.Money < 0) {
|
||||
_buttonText.text = "Game Over";
|
||||
}
|
||||
else {
|
||||
_buttonText.text = "Next Day";
|
||||
}
|
||||
}
|
||||
|
||||
public void ConfirmEnd() {
|
||||
GameController.Instance.Reset();
|
||||
if (GameController.Instance.Money < 0) {
|
||||
GameController.GameOver(GameController.LooseCondition.Bankrupt);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user