上传文件至 Assets/scripts

ore
This commit is contained in:
yanghaojing 2024-11-27 10:13:04 +08:00
parent 5855906c9c
commit 6448ba337c

29
Assets/scripts/Ore.cs Normal file
View File

@ -0,0 +1,29 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Ore : MonoBehaviour
{
public int OreHp;
// Start is called before the first frame update
void Start()
{
}
public void OreHpDown(int hp)
{
if (OreHp <=0) return;
OreHp-=hp;
}
// Update is called once per frame
void Update()
{
if(OreHp<=0)
{
//ToDo
Destroy(gameObject);
}
}
}