﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SpaceObject : MonoBehaviour
{
    //List of all Space objects.
    //Used by SpaceBoundary to loop objects inside a bounding volume
    public static List<SpaceObject> All = new List<SpaceObject>();

    public virtual void OnEnable()
    {
        //Add when created
        All.Add(this);
    }

    public virtual void OnDisable()
    {
        //Remove when destroyed
        All.Remove(this);
    }

    public void Teleport(Vector3 position)
    {
        //TODO: Maybe spawn some teleport effects here?
        transform.position = position;
    }
}
