Пример #1
0
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();

            serializedObject.Update();

            EditorGUILayout.Space();

            if (GUILayout.Button("Open In Flux Editor"))
            {
                FSequenceEditorWindow.Open(_sequence);
            }

            EditorGUILayout.Space();

            if (GUILayout.Button(_advancedInspector ? "Normal Inspector" : "Advanced Inspector"))
            {
                _advancedInspector = !_advancedInspector;
            }

            if (_advancedInspector)
            {
                EditorGUILayout.PropertyField(_content);

                bool showContent = (_sequence.Content.hideFlags & HideFlags.HideInHierarchy) == 0;

                EditorGUI.BeginChangeCheck();
                showContent = EditorGUILayout.Toggle("Show Content", showContent);
                if (EditorGUI.EndChangeCheck())
                {
                    if (showContent)
                    {
                        _sequence.Content.transform.hideFlags &= ~HideFlags.HideInHierarchy;
                    }
                    else
                    {
                        _sequence.Content.transform.hideFlags |= HideFlags.HideInHierarchy;
                    }
                }
            }
            serializedObject.ApplyModifiedProperties();
        }
Пример #2
0
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();

            Rect r = GUILayoutUtility.GetRect(EditorGUIUtility.currentViewWidth, EditorGUIUtility.singleLineHeight);

            r.width -= EditorGUIUtility.labelWidth;

            EditorGUI.PrefixLabel(r, new GUIContent("Frame Rate"));

            r.width += EditorGUIUtility.labelWidth;

            EditorGUI.BeginChangeCheck();
            r.xMin += EditorGUIUtility.labelWidth;

            int frameRate = FGUI.FrameRatePopup(r, _sequence.FrameRate);

            if (EditorGUI.EndChangeCheck())
            {
                if (frameRate == -1)
                {
                    FChangeFrameRateWindow.Show(new Vector2(r.xMin - EditorGUIUtility.labelWidth, r.yMax), _sequence, FSequenceInspector.Rescale);
                    EditorGUIUtility.ExitGUI();
                }
                else
                {
                    Rescale(_sequence, frameRate, true);
                }
            }

            serializedObject.Update();

            EditorGUILayout.PropertyField(_onFinishedCallback);

            EditorGUILayout.Space();

            if (GUILayout.Button("Open In Flux Editor"))
            {
                FSequenceEditorWindow.Open(_sequence);
            }

            EditorGUILayout.Space();

            if (GUILayout.Button(_advancedInspector ? "Normal Inspector" : "Advanced Inspector"))
            {
                _advancedInspector = !_advancedInspector;
            }

            if (_advancedInspector)
            {
//				serializedObject.Update();
                EditorGUILayout.PropertyField(_content);
//				serializedObject.ApplyModifiedProperties();

                bool showContent = (_sequence.Content.hideFlags & HideFlags.HideInHierarchy) == 0;

                EditorGUI.BeginChangeCheck();
                showContent = EditorGUILayout.Toggle("Show Content", showContent);
//				bool showTimelines = EditorGUILayout.Toggle( "Show Timelines", (_timelineContainer.objectReferenceValue.hideFlags & HideFlags.HideInHierarchy) == 0 );
                if (EditorGUI.EndChangeCheck())
                {
                    if (showContent)
                    {
//						_timelineContainer.objectReferenceValue.hideFlags &= ~HideFlags.HideInHierarchy;
                        _sequence.Content.transform.hideFlags &= ~HideFlags.HideInHierarchy;
//						for( int i = 0; i != _sequence.Containers.Count; ++i )
//							_sequence.Containers[i].transform.hideFlags &= ~HideFlags.HideInHierarchy;
                    }
                    else
                    {
                        _sequence.Content.transform.hideFlags |= HideFlags.HideInHierarchy;
//						_timelineContainer.objectReferenceValue.hideFlags |= HideFlags.HideInHierarchy;
//						for( int i = 0; i != _sequence.Containers.Count; ++i )
//							_sequence.Containers[i].transform.hideFlags |= HideFlags.HideInHierarchy;
                    }
                }
            }
            serializedObject.ApplyModifiedProperties();
//			serializedObject.ApplyModifiedProperties();
//			if( GUILayout.Button("Play") )
//				_sequence.Play();
        }
Пример #3
0
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();

            Rect r = GUILayoutUtility.GetRect(EditorGUIUtility.currentViewWidth, EditorGUIUtility.singleLineHeight);

            r.width -= EditorGUIUtility.labelWidth;

            EditorGUI.PrefixLabel(r, new GUIContent("Frame Rate"));

            r.width += EditorGUIUtility.labelWidth;

            EditorGUI.BeginChangeCheck();
            r.xMin += EditorGUIUtility.labelWidth;

            int frameRate = FGUI.FrameRatePopup(r, _sequence.FrameRate);

            if (EditorGUI.EndChangeCheck())
            {
                if (frameRate == -1)
                {
                    FChangeFrameRateWindow.Show(new Vector2(r.xMin - EditorGUIUtility.labelWidth, r.yMax), _sequence, FSequenceInspector.Rescale);
                    EditorGUIUtility.ExitGUI();
                }
                else
                {
                    Rescale(_sequence, frameRate, true);
                }
            }

            EditorGUILayout.Space();

            if (GUILayout.Button("Open In Flux Editor"))
            {
                FSequenceEditorWindow.Open(_sequence);
            }

            EditorGUILayout.Space();

            if (GUILayout.Button(_advancedInspector ? "Normal Inspector" : "Advanced Inspector"))
            {
                _advancedInspector = !_advancedInspector;
            }

            if (_advancedInspector)
            {
                EditorGUILayout.PropertyField(_timelineContainer);

                EditorGUI.BeginChangeCheck();
                bool showTimelines = EditorGUILayout.Toggle("Show Timelines", (_timelineContainer.objectReferenceValue.hideFlags & HideFlags.HideInHierarchy) == 0);
                if (EditorGUI.EndChangeCheck())
                {
                    if (showTimelines)
                    {
                        _timelineContainer.objectReferenceValue.hideFlags &= ~HideFlags.HideInHierarchy;
                    }
                    else
                    {
                        _timelineContainer.objectReferenceValue.hideFlags |= HideFlags.HideInHierarchy;
                    }
                }
            }

//			if( GUILayout.Button("Play") )
//				_sequence.Play();
        }