1
Fork 0
slime-blood-and-pain/Assets/Scripts/EntityItem.cs

28 lines
No EOL
642 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class EntityItem : Entity
{
public virtual string Name {
get {
Debug.LogWarning("No name given to an item");
return "";
}
}
protected override void Start() {
base.Start();
overlappable = true;
}
public virtual void OnPickup(EntityPlayer player) {
messageBar.Write("Picked up: " + Name, Color.yellow);
Destroy(gameObject);
}
public override void Die() {
messageBar.Write("Destroyed: " + Name, Color.red);
Destroy(gameObject);
}
}