Exemple #1
0
    protected override void StoreTimeData()
    {
        //make a new time data
        TimeData temp;

        temp.Position = transform.position;
        temp.Scale    = transform.localScale;
        temp.Velocity = velocity;
        TimeDataList.Add(temp);
        if (TimeDataList.Count > FramesStored)
        {
            TimeDataList.RemoveAt(0);
        }
    }
Exemple #2
0
 protected override void ReverseFrame()
 {
     transform.position   = TimeDataList[TimeDataList.Count - 1].Position;
     transform.localScale = TimeDataList[TimeDataList.Count - 1].Scale;
     velocity             = TimeDataList[TimeDataList.Count - 1].Velocity;
     TimeDataList.RemoveAt(TimeDataList.Count - 1);
     if (TimeDataList.Count == 0)
     {
         TimeController.CurrentTimeState = TimeController.TimeState.Normal;
     }
     CurrentFrame += 1;
     if (CurrentFrame >= FramesBetweenSquares)
     {
         CurrentFrame = 0;
         Instantiate(InstantiateSquare).transform.position = transform.position;
     }
 }