Space-Smash-Out/Assets/Scripts/UI/BoostCapacityUI.cs
Jakob Feldmann 64162cb4a1 feat: whole project restructuring
This can be seen as the initial state of the project after the released demo.

The changes include:
- New ship models
- Singleton manager structure to keep project scaleable in the future
     - Managing players, their settings, character choices, statistics, match setups, controls etc. in a separate decoupled scene
- Main menu with transitions to the arena scene
- Beginnings of a custom audio solution
- Logging with Log4Net

It is really a complete overhaul of the projects structure and management.
2024-04-01 23:06:39 +02:00

38 lines
818 B
C#

using TMPro;
using Unity.VisualScripting;
using UnityEngine;
using UnityEngine.UI;
public class BoostCapacityUI : MonoBehaviour
{
public Color goodColor = Color.green;
public Color criticalColor = Color.red;
[SerializeField] private int playerNumber = 0;
[SerializeField] private Image fillImage;
[SerializeField] private TextMeshProUGUI hint;
private float minBoostRatio = 0.3f;
public void SetMinBoostRatio(float minBoostRatio)
{
this.minBoostRatio = minBoostRatio;
}
public void SetPlayerName(Player p)
{
hint.SetText($"Boost Capacity \n {p.playerName} \n {p.character.shipName}");
}
public void UpdateFill(float fill)
{
fillImage.fillAmount = fill;
if (fillImage.fillAmount <= minBoostRatio)
{
fillImage.color = criticalColor;
}
else
{
fillImage.color = goodColor;
}
}
}