예제 #1
0
//----------------------------------------------------------------------------------------------------------------------


        private void DrawCaptureSelectedFramesGUI(TimelineClip timelineClip, PlayableFrameClipData clipData)
        {
            TrackAsset track = timelineClip.GetParentTrack();

            GUILayout.BeginHorizontal();
            bool markerVisibility = InspectorUtility.DrawFrameMarkersGUI(m_asset);

            GUILayout.FlexibleSpace();
            EditorGUI.BeginDisabledGroup(!markerVisibility);
            if (GUILayout.Button("Capture All", GUILayout.Width(80)))
            {
                Undo.RegisterCompleteObjectUndo(track, "Capturing all frames");
                clipData.SetAllPlayableFramesProperty(PlayableFramePropertyID.USED, true);
            }
            if (GUILayout.Button("Reset", GUILayout.Width(50)))
            {
                Undo.RegisterCompleteObjectUndo(track, "Capturing no frames");
                clipData.SetAllPlayableFramesProperty(PlayableFramePropertyID.USED, false);
            }
            EditorGUI.EndDisabledGroup();
            GUILayout.EndHorizontal();
        }
예제 #2
0
//----------------------------------------------------------------------------------------------------------------------


        private void DrawLockFramesGUI(TimelineClip timelineClip, PlayableFrameClipData clipData)
        {
            TrackAsset track = timelineClip.GetParentTrack();

            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(clipData);
                    }
                    else
                    {
                        UnlockSISData();
                    }
                }

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