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

public class VectorSaver : MonoBehaviour {


    int SAVE_MAX_FRAME = 60;
    private Vector3[] positionList = new Vector3[60];

    // Use this for initialization
    void Start()
    {

        for (int index = 0; index < SAVE_MAX_FRAME; ++index)
        {
            positionList[index] = new Vector3(0, 0, 0);
        }

    }

    public void SavePosition(Vector3 vector)
    {

        for (int index = 0; index < SAVE_MAX_FRAME - 1; ++index)
        {
            positionList[index + 1] = positionList[index];
        }

        positionList[0] = vector;

    }

    public Vector3[] GetVectorList()
    {
        return positionList;
    }

    public Vector3 GetDirection()
    {
        return positionList[0] - positionList[SAVE_MAX_FRAME - 1];
    }

}
