Waffen Prefab fix Game map spielbar mit Charakter waffe kann schießen pause maneger und Equiepment bearbeitet und health skript hinzugefügt
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
//Oliver
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine;
|
||||
|
||||
public class Health : MonoBehaviour
|
||||
{
|
||||
public int maxHP = 100;
|
||||
public int curHP;
|
||||
void Start()
|
||||
{
|
||||
curHP = maxHP;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
if(curHP <= 0)
|
||||
{
|
||||
die();
|
||||
}
|
||||
}
|
||||
public void die()
|
||||
{
|
||||
Destroy(this);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user