public void AddKeyframe() { List <V_Skeleton_Frame> newFrames = new List <V_Skeleton_Frame>(frames); if (currentAnimFrame.frameCount != -1) { //Is keyframe, duplicate this one V_Skeleton_Frame cloned = currentAnimFrame.CloneNew(); newFrames.Insert(newFrames.IndexOf(currentAnimFrame) + 1, cloned); SetFrames(newFrames.ToArray()); currentFrame = System.Array.IndexOf(frames, cloned); currentAnimFrame = newFrames[currentFrame]; } else { //Not keyframe, clone last keyframe List <V_Skeleton_Frame> keyframes = GetKeyframes(); V_Skeleton_Frame cloned = keyframes[keyframes.Count - 1].CloneNew(); newFrames.Add(cloned); SetFrames(newFrames.ToArray()); currentFrame = System.Array.IndexOf(frames, cloned); currentAnimFrame = newFrames[currentFrame]; } RemakeTween(); }
public void AddKeyframeFirstToEnd() { List <V_Skeleton_Frame> newFrames = new List <V_Skeleton_Frame>(frames); List <V_Skeleton_Frame> keyframes = GetKeyframes(); V_Skeleton_Frame firstKeyframe = keyframes[0]; V_Skeleton_Frame cloned = firstKeyframe.CloneNew(); newFrames.Add(cloned); SetFrames(newFrames.ToArray()); currentFrame = System.Array.IndexOf(frames, cloned); currentAnimFrame = newFrames[currentFrame]; RemakeTween(); }