void OnDisable() { window = null; if (aData != null && saveChanges) { AMTakeData take = aData.currentTake; bool saveNumFrames = true; string label = take.name + ": Modify Settings"; AMTimeline.RegisterTakesUndo(aData, label, true); take = aData.currentTake; if (saveNumFrames) { Undo.RegisterCompleteObjectUndo(AnimatorDataEdit.GetKeysAndTracks(take), label); // save end frame padding take.endFramePadding = endFramePadding; } // save frameRate take.frameRate = frameRate; //save other data take.numLoop = loopCount; take.loopMode = loopMode; take.loopBackToFrame = loopBackFrameCheck ? Mathf.Clamp(loopBackFrame, 1, totalFrames) : 0; EditorWindow.GetWindow(typeof(AMTimeline)).Repaint(); } }