_xiaofang/xiaofang/Assets/Script/hylScripts/PlayerState.cs
huyulong 13f74a2139 add
2024-12-05 09:21:07 +08:00

44 lines
723 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerState : MonoBehaviour
{
[Header("鯤소悧沂좆")]
public float totalHp = 100;
[Header("鯤소뎠품沂좆")]
public float currentHp;
[Header("둬예제")]
public float defend;
// Start is called before the first frame update
void Start()
{
currentHp = totalHp;
}
// Update is called once per frame
void Update()
{
}
public void beHurt(float hurt)
{
if(currentHp >0)
{
currentHp -= hurt;
Debug.Log(currentHp);
}
if(currentHp <= 0)
{
Debug.Log("콱价죄");
}
}
}