Added info text
This commit is contained in:
@@ -4,17 +4,21 @@ namespace InterfaceOff
|
||||
{
|
||||
public class MovingWindow : WindowBase
|
||||
{
|
||||
private int m_Health = 5;
|
||||
private int m_Health = int.MaxValue;
|
||||
|
||||
public override void OnWindowInstantiation()
|
||||
{
|
||||
Components.WindowImage.color = Color.blue;
|
||||
/* Creates a random health value */
|
||||
m_Health = Random.Range(2, 6);
|
||||
Components.InfoText.text = $"{m_Health}";
|
||||
}
|
||||
|
||||
public override void OnWindowClicked()
|
||||
{
|
||||
/* Decreases health and destroys if at 0 */
|
||||
m_Health--;
|
||||
Components.InfoText.text = $"{m_Health}";
|
||||
|
||||
if (m_Health <= 0)
|
||||
{
|
||||
Destroy(gameObject);
|
||||
|
||||
Reference in New Issue
Block a user