1
0
Fork 0
Bildschirmflausch-LD41/Assets/Scripts/Entities/Entity.cs
2018-04-21 16:20:38 +02:00

32 lines
684 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public abstract class Entity {
EntityObjective referringObjective;
GameObject entityPrefab;
GameObject instance;
// Constructor
public Entity(EntityObjective referringObjective, GameObject entityPrefab)
{
this.referringObjective = referringObjective;
this.entityPrefab = entityPrefab;
}
// spawns the entity
public void Spawn(Transform spawnPoint)
{
// instance = GameObject.Instantiate (entityPrefab);
// instance.transform = spawnPoint;
}
// kills the entity
public void Kill()
{
GameObject.Destroy (instance);
referringObjective.Remove (this);
instance = null;
}
}