//----------------------------------------------------------------------------------------------------------------------    
    public override void DrawOverlay(IMarker m, MarkerUIStates uiState, MarkerOverlayRegion region)
    {
        FrameMarker marker = m as FrameMarker;
        if (null == marker)
            return;


        SISPlayableFrame playableFrame = marker.GetOwner();
        TimelineClipSISData timelineClipSISData = playableFrame.GetOwner();
        PlayableFramePropertyID inspectedPropertyID = timelineClipSISData.GetInspectedProperty();
        switch (inspectedPropertyID) {
            case PlayableFramePropertyID.USED: {
                
                if (playableFrame.IsLocked()) {
                    //At the moment, all locked frames are regarded as inactive 
                    if (playableFrame.IsUsed()) {
                        Graphics.DrawTexture(region.markerRegion, EditorTextures.GetInactiveCheckedTexture());
                    }
                    Rect lockRegion = region.markerRegion;
                    lockRegion.x -= 5;
                    lockRegion.y -= 8;
                    Graphics.DrawTexture(lockRegion, EditorTextures.GetLockTexture());                    
                } else {
                    if (playableFrame.IsUsed()) {
                        Graphics.DrawTexture(region.markerRegion, EditorTextures.GetCheckedTexture());
                    }
                    
                }
                break;
            }
            case PlayableFramePropertyID.LOCKED: {
                if (playableFrame.IsLocked()) {
                    Graphics.DrawTexture(region.markerRegion, EditorTextures.GetLockTexture());                    
                }
                break;
            }
            
        }
        
    }
//----------------------------------------------------------------------------------------------------------------------


        private void ShowLockFramesGUI(TimelineClip timelineClip, TimelineClipSISData timelineClipSISData)
        {
            TrackAsset track = timelineClip.parentTrack;

            using (new EditorGUILayout.HorizontalScope()) {
                EditorGUILayout.PrefixLabel("Lock Frames");

                bool lockMode = GUILayout.Toggle(m_lockMode, EditorTextures.GetLockTexture(), "Button",
                                                 GUILayout.Height(20f), GUILayout.Width(30f));
                if (lockMode != m_lockMode) //lock state changed
                {
                    if (lockMode)
                    {
                        LockSISData(timelineClipSISData);
                    }
                    else
                    {
                        UnlockSISData();
                    }
                }

                GUILayout.FlexibleSpace();
                EditorGUI.BeginDisabledGroup(!m_lockMode);
                if (GUILayout.Button("Lock All", GUILayout.Width(80)))
                {
                    Undo.RegisterCompleteObjectUndo(track, "RenderCachePlayableAsset: Locking all frames");
                    timelineClipSISData.SetAllPlayableFramesProperty(PlayableFramePropertyID.LOCKED, true);
                }
                if (GUILayout.Button("Reset", GUILayout.Width(50)))
                {
                    Undo.RegisterCompleteObjectUndo(track, "RenderCachePlayableAsset: Locking no frame");
                    timelineClipSISData.SetAllPlayableFramesProperty(PlayableFramePropertyID.LOCKED, false);
                }
                EditorGUI.EndDisabledGroup();
            }
        }