Added a health bar
This commit is contained in:
15
Assets/Scripts/HealthBar.cs
Normal file
15
Assets/Scripts/HealthBar.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace InterfaceOff.WorldScene
|
||||
{
|
||||
public class HealthBar : MonoBehaviour
|
||||
{
|
||||
public Transform HealthBarObject;
|
||||
public WindowSpawner Spawner;
|
||||
|
||||
private void Update()
|
||||
{
|
||||
HealthBarObject.localScale = new Vector3(100f, (20 - Spawner.SpawnedWindowCount) * 5f, 100f);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user