27 lines
521 B
C#
27 lines
521 B
C#
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);
|
|
}
|
|
}
|