Batch 1 - Scripts
This commit is contained in:
@@ -7,8 +7,12 @@ public class UI_Manager : MonoBehaviour
|
||||
public static UI_Manager Instance;
|
||||
|
||||
[SerializeField] private TextMeshProUGUI playerCarryText;
|
||||
[SerializeField] private TextMeshProUGUI playerCashText;
|
||||
[SerializeField] private TextMeshProUGUI playerDepositText;
|
||||
|
||||
[SerializeField] private TextMeshProUGUI teammate1CarryText;
|
||||
[SerializeField] private TextMeshProUGUI teammate2CarryText;
|
||||
|
||||
[SerializeField] private TextMeshProUGUI enemy1CarryText;
|
||||
[SerializeField] private TextMeshProUGUI enemy1DepositText;
|
||||
|
||||
@@ -18,10 +22,14 @@ public class UI_Manager : MonoBehaviour
|
||||
[SerializeField] private TextMeshProUGUI actionTimerText;
|
||||
[SerializeField] private TextMeshProUGUI depositTimerText;
|
||||
|
||||
[SerializeField] private TextMeshProUGUI objectiveText;
|
||||
|
||||
[SerializeField] private Slider playerProgressSlider;
|
||||
[SerializeField] private Slider enemy1ProgressSlider;
|
||||
[SerializeField] private Slider enemy2ProgressSlider;
|
||||
|
||||
[SerializeField] private CashPopupUI cashPopup;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
Instance = this;
|
||||
@@ -35,6 +43,27 @@ public class UI_Manager : MonoBehaviour
|
||||
$"{amount:N0}";
|
||||
}
|
||||
|
||||
public void ShowCashPopup(int amount)
|
||||
{
|
||||
cashPopup?.Show(amount);
|
||||
}
|
||||
|
||||
public void UpdatePlayerCash(int amount)
|
||||
{
|
||||
if (playerCashText != null)
|
||||
playerCashText.text = $"${amount:N0}";
|
||||
}
|
||||
|
||||
public void UpdateTeammate1Cash(int amount)
|
||||
{
|
||||
teammate1CarryText.text = $"${amount:N0}";
|
||||
}
|
||||
|
||||
public void UpdateTeammate2Cash(int amount)
|
||||
{
|
||||
teammate2CarryText.text = $"${amount:N0}";
|
||||
}
|
||||
|
||||
public void UpdatePlayerDepositCash(int amount)
|
||||
{
|
||||
playerDepositText.text =
|
||||
@@ -73,17 +102,26 @@ public class UI_Manager : MonoBehaviour
|
||||
|
||||
public void UpdateDepositTimer(float timeLeft)
|
||||
{
|
||||
if (objectiveText != null)
|
||||
objectiveText.gameObject.SetActive(false);
|
||||
|
||||
depositTimerText.text =
|
||||
"Depositing: " + Mathf.CeilToInt(timeLeft).ToString();
|
||||
"Depositing: " + Mathf.CeilToInt(timeLeft);
|
||||
}
|
||||
|
||||
public void HideDepositTimer()
|
||||
{
|
||||
depositTimerText.text = "";
|
||||
|
||||
if (objectiveText != null)
|
||||
objectiveText.gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
public void UpdateActionTimer(string actionName, float timeLeft)
|
||||
{
|
||||
if (objectiveText != null)
|
||||
objectiveText.gameObject.SetActive(false);
|
||||
|
||||
actionTimerText.text =
|
||||
actionName + ": " + Mathf.CeilToInt(timeLeft);
|
||||
}
|
||||
@@ -91,10 +129,34 @@ public class UI_Manager : MonoBehaviour
|
||||
public void HideActionTimer()
|
||||
{
|
||||
actionTimerText.text = "";
|
||||
|
||||
if (objectiveText != null)
|
||||
objectiveText.gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
public void ShowInteractionPrompt(string message)
|
||||
{
|
||||
if (objectiveText != null)
|
||||
objectiveText.gameObject.SetActive(false);
|
||||
|
||||
actionTimerText.text = message;
|
||||
}
|
||||
|
||||
public void ShowOpenVaultObjective()
|
||||
{
|
||||
if (objectiveText != null)
|
||||
objectiveText.text = "-> Open a vault to collect cash.";
|
||||
}
|
||||
|
||||
public void ShowDepositObjective()
|
||||
{
|
||||
if (objectiveText != null)
|
||||
objectiveText.text = "-> Deposit your cash at a deposit dtation.";
|
||||
}
|
||||
|
||||
public void HideObjective()
|
||||
{
|
||||
if (objectiveText != null)
|
||||
objectiveText.text = "";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user