using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlayerState : MonoBehaviour { [Header("玩家总血量")] public float totalHp; [Header("玩家当前血量")] public float currentHp; [Header("抵抗力")] public float defend; // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { } public void beHurt(int hurt) { Debug.Log(currentHp -= hurt); if(currentHp <= 0) { Debug.Log("你死了"); } } }