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

public class EscalatorStep : MonoBehaviour 
{

	public Escalator escalator;

	public Transform waypoint;

	void Update () 
	{
		if (this.transform.position == waypoint.position)
		{
			waypoint = escalator.GetNextWaypoint (waypoint.position);
		}

		this.transform.position = Vector3.MoveTowards (this.transform.position, waypoint.position, 0.05f);
	}
	/*
	void OnCollisionEnter2D (Collision2D other)
	{
		other.transform.parent = this.transform;
	}

	void OnCollisionStay2D (Collision2D other)
	{
		other.transform.parent = this.transform;
	}

	void OnCollisionExit2D (Collision2D other)
	{
		other.transform.parent = null;
	}
	*/
}
