using UnityEngine;
using System.Collections;
using Framework.ActorComponents;

public class MovingPlatform : PhysicsMover
{
    public Vector3[] positions;

    private int positionIndex;

	// Use this for initialization
	protected override void InnerStart () 
    {
	
	}
	
	// Update is called once per frame
    protected override void InnerUpdate() 
    {
        MoveToward(this.positions[positionIndex], 3000f, 10f, new Vector3(1, 1, 1));
        if (Vector3.Distance(this.transform.position, this.positions[positionIndex]) < 0.5f)
        {
            this.positionIndex += 1;
            if (this.positionIndex >= positions.Length)
            {
                this.positionIndex = 0;
            }
        }
	}
}
