public virtual void OnToggle(bool on) { Undo.RecordObject(Track, on ? "enable" : "disable"); Track.enabled = on; EditorUtility.SetDirty(Track); if (Track.RequiresEditorCache) { if (on) { Track.CreateCache(); } else { Track.ClearCache(); } } if (!SequenceEditor.Sequence.IsStopped) { int currentFrame = SequenceEditor.Sequence.CurrentFrame; SequenceEditor.Stop(); SequenceEditor.SetCurrentFrame(currentFrame); } SequenceEditor.SetDirty(this); SequenceEditor.NotifyDirtyTracks(); }