void AddKeyframe(KeyframeBase _keyframe) { int idToChange = -1; int id = 0; foreach (KeyframeBase keyFrame in activeScenesTimeline.keyframes) { if (keyFrame.avatar.avatarID == _keyframe.avatar.avatarID && keyFrame.time == _keyframe.time) { idToChange = id; } id++; } ScenesTimeline st = activeScenesTimeline; if (idToChange != -1 && st.keyframes.Count >= idToChange) { st.keyframes[idToChange] = _keyframe; } else { GetActiveScenesTimeline().keyframes.Add(_keyframe); } }