First project upload
This commit is contained in:
100
Assets/New Lowpoly Models/Scripts/UI_Manager.cs
Normal file
100
Assets/New Lowpoly Models/Scripts/UI_Manager.cs
Normal file
@@ -0,0 +1,100 @@
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class UI_Manager : MonoBehaviour
|
||||
{
|
||||
public static UI_Manager Instance;
|
||||
|
||||
[SerializeField] private TextMeshProUGUI playerCarryText;
|
||||
[SerializeField] private TextMeshProUGUI playerDepositText;
|
||||
|
||||
[SerializeField] private TextMeshProUGUI enemy1CarryText;
|
||||
[SerializeField] private TextMeshProUGUI enemy1DepositText;
|
||||
|
||||
[SerializeField] private TextMeshProUGUI enemy2CarryText;
|
||||
[SerializeField] private TextMeshProUGUI enemy2DepositText;
|
||||
|
||||
[SerializeField] private TextMeshProUGUI actionTimerText;
|
||||
[SerializeField] private TextMeshProUGUI depositTimerText;
|
||||
|
||||
[SerializeField] private Slider playerProgressSlider;
|
||||
[SerializeField] private Slider enemy1ProgressSlider;
|
||||
[SerializeField] private Slider enemy2ProgressSlider;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
Instance = this;
|
||||
|
||||
HideDepositTimer();
|
||||
}
|
||||
|
||||
public void UpdatePlayerCarryCash(int amount)
|
||||
{
|
||||
playerCarryText.text =
|
||||
$"{amount:N0}";
|
||||
}
|
||||
|
||||
public void UpdatePlayerDepositCash(int amount)
|
||||
{
|
||||
playerDepositText.text =
|
||||
$"${amount:N0}/10,000";
|
||||
|
||||
playerProgressSlider.value = amount / 10000f;
|
||||
}
|
||||
|
||||
public void UpdateEnemy1CarryCash(int amount)
|
||||
{
|
||||
enemy1CarryText.text =
|
||||
$"{amount:N0}";
|
||||
}
|
||||
|
||||
public void UpdateEnemy1DepositCash(int amount)
|
||||
{
|
||||
enemy1DepositText.text =
|
||||
$"${amount:N0}/10,000";
|
||||
|
||||
enemy1ProgressSlider.value = amount / 10000f;
|
||||
}
|
||||
|
||||
public void UpdateEnemy2CarryCash(int amount)
|
||||
{
|
||||
enemy2CarryText.text =
|
||||
$"{amount:N0}";
|
||||
}
|
||||
|
||||
public void UpdateEnemy2DepositCash(int amount)
|
||||
{
|
||||
enemy2DepositText.text =
|
||||
$"${amount:N0}/10,000";
|
||||
|
||||
enemy2ProgressSlider.value = amount / 10000f;
|
||||
}
|
||||
|
||||
public void UpdateDepositTimer(float timeLeft)
|
||||
{
|
||||
depositTimerText.text =
|
||||
"Depositing: " + Mathf.CeilToInt(timeLeft).ToString();
|
||||
}
|
||||
|
||||
public void HideDepositTimer()
|
||||
{
|
||||
depositTimerText.text = "";
|
||||
}
|
||||
|
||||
public void UpdateActionTimer(string actionName, float timeLeft)
|
||||
{
|
||||
actionTimerText.text =
|
||||
actionName + ": " + Mathf.CeilToInt(timeLeft);
|
||||
}
|
||||
|
||||
public void HideActionTimer()
|
||||
{
|
||||
actionTimerText.text = "";
|
||||
}
|
||||
|
||||
public void ShowInteractionPrompt(string message)
|
||||
{
|
||||
actionTimerText.text = message;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user