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

public class BaseObject : MonoBehaviour
{
	[SerializeField]
	private Vector3 direction;

	public Vector3 Direction
	{
		get{ return direction; }
	}

	[SerializeField]
	private float speed = 5;

	[SerializeField]
	private LookAt lookAt;

	[SerializeField]
	private int type;

	public int Type
	{
		get{ return type; }
	}

	protected virtual void Update()
	{
		transform.Translate(direction * speed * Time.deltaTime);
	}

	public void SetDirection(Vector3 dir)
	{
		direction = dir;
		lookAt.Look(Direction);
	}
}
