Initial framework for upgrade shop
This commit is contained in:
17
Assets/UI overlay/WaveIndicator.cs
Normal file
17
Assets/UI overlay/WaveIndicator.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class WaveIndicator : MonoBehaviour
|
||||
{
|
||||
GameState gameState;
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
gameState = GameObject.FindGameObjectWithTag("GameController").GetComponent<GameState>();
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
GetComponent<TMPro.TMP_Text>().text = "Wave: "+gameState.wave;
|
||||
}
|
||||
}
|
||||
2
Assets/UI overlay/WaveIndicator.cs.meta
Normal file
2
Assets/UI overlay/WaveIndicator.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 718783a6a2d0457d590a9bbe51b7d5e4
|
||||
17
Assets/UI overlay/healthIndicator.cs
Normal file
17
Assets/UI overlay/healthIndicator.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class healthIndicator : MonoBehaviour
|
||||
{
|
||||
GameObject player;
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
player = GameObject.FindGameObjectWithTag("Player");
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
GetComponent<TMPro.TMP_Text>().text = "Health: "+player.GetComponent<Teo>().health.ToString()+"/100";
|
||||
}
|
||||
}
|
||||
2
Assets/UI overlay/healthIndicator.cs.meta
Normal file
2
Assets/UI overlay/healthIndicator.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 07e7096bcd8103c3faadeefc30c8a2f4
|
||||
Reference in New Issue
Block a user