public AnimationFrameRaw getState()
    {
        AnimationFrameRaw tempFrame = new AnimationFrameRaw(modelTransforms.Length, animationName + "_Frame_" + frameNumber.ToString());

        //Iterate through each transform in the model and gather its position and rotation
        for (int t = 0; t < modelTransforms.Length; ++t)
        {
            tempFrame.theTransforms[t]  = modelTransforms[t];
            tempFrame.positionStates[t] = modelTransforms[t].localPosition;
            tempFrame.rotationStates[t] = modelTransforms[t].localRotation;
        }

        return(tempFrame);
    }
    void redoMovement()
    {
        if (redoFrameStack.Count == 0)
        {
            return;
        }

        //Set NAO positions and rotations to last position
        AnimationFrameRaw lastState = redoFrameStack.Pop();

        //Add to redo movement stack
        undoFrameStack.Push(workingAnimation.getState());

        //Iterate through each transform in the model and gather its position and rotation
        for (int t = 0; t < lastState.theTransforms.Length; ++t)
        {
            lastState.theTransforms[t].localPosition = lastState.positionStates[t];
            lastState.theTransforms[t].localRotation = lastState.rotationStates[t];
        }
    }
 public void addState(AnimationFrameRaw state)
 {
     //Add frame to array of frames
     frames.Add(state);
     ++frameNumber;
 }