mirror of
https://github.com/Steffo99/beat-td.git
synced 2024-11-23 15:54:18 +00:00
29 lines
584 B
C#
29 lines
584 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class GameStatus : MonoBehaviour {
|
|
|
|
public int money = 0;
|
|
public int lives = 10;
|
|
|
|
public GameObject moneyTextObject;
|
|
private Text moneyText;
|
|
|
|
void Start()
|
|
{
|
|
moneyText = moneyTextObject.GetComponent<Text>();
|
|
}
|
|
|
|
void Update()
|
|
{
|
|
moneyText.text = money.ToString();
|
|
}
|
|
|
|
public void EnemyFinishedPath(GameObject enemy)
|
|
{
|
|
lives -= enemy.GetComponent<EnemyStatus>().livesCost;
|
|
Destroy(enemy);
|
|
}
|
|
}
|