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Ĭ<70><C4AC>Ϊ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("<22>ı<EFBFBD>Ѫ<EFBFBD><D1AA>");
|
|||
|
this.Hp += number;
|
|||
|
}
|
|||
|
|
|||
|
public void ClearNpc()
|
|||
|
{
|
|||
|
Destroy(this.gameObject);
|
|||
|
}
|
|||
|
}
|