This commit is contained in:
Gerard Gascón 2025-04-24 16:56:52 +02:00
commit 862afc9b7a
478 changed files with 197737 additions and 0 deletions

21
Assets/Scripts/hasHP.cs Normal file
View file

@ -0,0 +1,21 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public abstract class hasHP: MonoBehaviour
{
public float MaxHP;
public float curHP;
private void Start() {
curHP = MaxHP;
}
public void damage(float d) {
curHP -= d;
if (curHP <= 0) {
Debug.Log(curHP);
this.die();
}
}
public abstract void die();
}