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

24 lines
612 B
C#
Raw Normal View History

2019-04-28 12:11:21 +00:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
2019-04-28 14:34:50 +00:00
public class EntityItem : Entity
2019-04-28 12:11:21 +00:00
{
2019-04-28 14:28:31 +00:00
public static string itemName = "White Triangle";
2019-04-28 13:29:17 +00:00
protected override void Start() {
base.Start();
2019-04-28 12:11:21 +00:00
overlappable = true;
}
2019-04-28 14:34:50 +00:00
public virtual void OnPickup(EntityPlayer player) {
2019-04-28 12:11:21 +00:00
Debug.LogWarning("OnPickup not overridden");
2019-04-28 14:28:31 +00:00
messageBar.Write("Picked up: " + itemName, Color.yellow);
Destroy(gameObject);
}
public override void Die() {
messageBar.Write("Destroyed: " + itemName, Color.red);
2019-04-28 13:29:17 +00:00
Destroy(gameObject);
2019-04-28 12:11:21 +00:00
}
}