1
0
Fork 0
Bildschirmflausch-LD41/Assets/Scripts/Entities/Entity.cs

21 lines
419 B
C#
Raw Normal View History

2018-04-21 12:22:17 +02:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
2018-04-21 17:27:28 +02:00
public abstract class Entity : MonoBehaviour{
2018-04-21 16:12:04 +02:00
EntityObjective referringObjective;
2018-04-21 12:22:17 +02:00
2018-04-21 16:12:04 +02:00
// Constructor
2018-04-21 17:27:28 +02:00
public Entity(EntityObjective referringObjective)
2018-04-21 16:12:04 +02:00
{
this.referringObjective = referringObjective;
}
// kills the entity
public void Kill()
{
2018-04-21 17:27:28 +02:00
if(referringObjective != null)
referringObjective.Remove (this.gameObject);
2018-04-21 12:22:17 +02:00
}
}