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
|
2018-04-21 19:50:12 +02:00
|
|
|
|
public virtual void Kill()
|
2018-04-21 16:12:04 +02:00
|
|
|
|
{
|
2018-04-21 17:27:28 +02:00
|
|
|
|
if(referringObjective != null)
|
|
|
|
|
referringObjective.Remove (this.gameObject);
|
2018-04-21 12:22:17 +02:00
|
|
|
|
}
|
|
|
|
|
}
|