//----------------------------------------------------------------------------------------------------------------------
        internal void SetAllPlayableFramesProperty(PlayableFramePropertyID id, bool val)
        {
            foreach (SISPlayableFrame playableFrame in m_playableFrames)
            {
                playableFrame.SetBoolProperty(id, val);
            }
        }
Example #2
0
        internal void SetBoolProperty(PlayableFramePropertyID id, bool val)
        {
#if UNITY_EDITOR
            if (GetBoolProperty(id) != val)
            {
                EditorSceneManager.MarkAllScenesDirty();
            }
#endif
            m_boolProperties[id] = new PlayableFrameBoolProperty(id, val);
        }
Example #3
0
//----------------------------------------------------------------------------------------------------------------------
        //Property
        internal bool GetBoolProperty(PlayableFramePropertyID propertyID)
        {
            if (null != m_boolProperties && m_boolProperties.ContainsKey(propertyID))
            {
                return(m_boolProperties[propertyID].GetValue());
            }

            switch (propertyID)
            {
            case PlayableFramePropertyID.USED: return(true);

            case PlayableFramePropertyID.LOCKED: return(false);

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

        SISPlayableFrame playableFrame = marker.GetOwner();
        
        //Check invalid PlayableFrame/ClipData. Perhaps because of unsupported Duplicate operation ?
        PlayableFrameClipData clipData = playableFrame?.GetOwner();
        if (clipData == null)
            return;
        
        PlayableFramePropertyID inspectedPropertyID = clipData.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;
            }
            
        }
        
    }
Example #5
0
        internal static void ToggleMarkerValueByContext(FrameMarker frameMarker)
        {
            SISPlayableFrame        playableFrame       = frameMarker.GetOwner();
            TimelineClipSISData     timelineClipSISData = playableFrame.GetOwner();
            PlayableFramePropertyID inspectedPropertyID = timelineClipSISData.GetInspectedProperty();

            switch (inspectedPropertyID)
            {
            case PlayableFramePropertyID.USED: {
                playableFrame.SetUsed(!playableFrame.IsUsed());
                break;
            }

            case PlayableFramePropertyID.LOCKED: {
                playableFrame.SetLocked(!playableFrame.IsLocked());
                break;
            }
            }
        }
Example #6
0
//----------------------------------------------------------------------------------------------------------------------
        private static void SetMarkerValueByContext(FrameMarker frameMarker, bool value)
        {
            SISPlayableFrame        playableFrame       = frameMarker.GetOwner();
            TimelineClipSISData     timelineClipSISData = playableFrame.GetOwner();
            PlayableFramePropertyID inspectedPropertyID = timelineClipSISData.GetInspectedProperty();

            switch (inspectedPropertyID)
            {
            case PlayableFramePropertyID.USED: {
                playableFrame.SetUsed(value);
                break;
            }

            case PlayableFramePropertyID.LOCKED: {
                playableFrame.SetLocked(value);
                break;
            }
            }
        }
Example #7
0
        public void OnAfterDeserialize()
        {
            m_boolProperties = new Dictionary <PlayableFramePropertyID, PlayableFrameBoolProperty>();
            if (null != m_serializedBoolProperties)
            {
                foreach (PlayableFrameBoolProperty prop in m_serializedBoolProperties)
                {
                    PlayableFramePropertyID id = prop.GetID();
                    m_boolProperties[id] = new PlayableFrameBoolProperty(id, prop.GetValue());
                }
            }

            if (null == m_marker)
            {
                return;
            }

            m_marker.SetOwner(this);
        }
//----------------------------------------------------------------------------------------------------------------------    
    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;
            }
            
        }
        
    }
 internal void SetInspectedProperty(PlayableFramePropertyID id)
 {
     m_inspectedPropertyID = id;
 }
Example #10
0
 internal PlayableFrameBoolProperty(PlayableFramePropertyID id, bool val)
 {
     m_propertyID    = id;
     m_propertyValue = val;
 }