1
Fork 0
slime-blood-and-pain/Assets/Scripts/EntityItemShop.cs
2019-04-29 15:27:26 +02:00

20 lines
No EOL
564 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class EntityItemShop : EntityItem {
public float hpChange = -1f;
public float maxHpChange = -1f;
protected virtual void OnPurchase(EntityPlayer player) {
Debug.LogWarning("OnPurchase not overridden");
}
public override void OnPickup(EntityPlayer player) {
player.hp += hpChange;
player.hpMax += maxHpChange;
OnPurchase(player);
messageBar.Write("Bought: " + Name, Color.yellow);
Destroy(gameObject);
}
}