using System.Collections; using System.Collections.Generic; using UnityEngine; public class npcInfo : MonoBehaviour { [Header("Hp默认为100")] public float Hp=100; public void ChangeHp(float number) { if ((this.Hp+ number) <=0) { PlayerInfo.instance.ChangeGold(10); Destroy(this.gameObject); return; } Debug.Log("改变血量"); this.Hp += number; } public void ClearNpc() { Destroy(this.gameObject); } }