Ejemplo n.º 1
0
        protected override bool DrawSidePanelContent(bool hasChanged)
        {
            var useCurve             = m_SerializedObject.FindProperty("useCurve");
            var outputSequenceLength = m_SerializedObject.FindProperty("outputSequenceLength");

            EditorGUI.BeginChangeCheck();

            int length    = outputSequenceLength.intValue;
            int newlength = EditorGUILayout.IntSlider(VFXToolboxGUIUtility.Get("Sequence Length"), length, 1, InputSequence.length);

            if (newlength != length)
            {
                outputSequenceLength.intValue = newlength;
            }

            EditorGUILayout.PropertyField(useCurve, VFXToolboxGUIUtility.Get("Use Retiming Curve"));

            if (settings.useCurve)
            {
                m_CurveDrawer.SetBounds(new Rect(0, 0, 1, InputSequence.length - 1));

                if (m_CurveDrawer.OnGUILayout())
                {
                    hasChanged = true;
                }
            }

            if (EditorGUI.EndChangeCheck())
            {
                hasChanged = true;
            }

            return(hasChanged);
        }
Ejemplo n.º 2
0
        public override bool OnInspectorGUI(bool changed, SerializedObject serializedObject)
        {
            if (m_CurveDrawer == null)
            {
                m_CurveDrawer = new CurveDrawer("Retime Curve", 0.0f, 1.0f, 0.0f, inputSequenceLength, 140, false);
                m_CurveDrawer.AddCurve(serializedObject.FindProperty("curve"), new Color(0.5f, 0.75f, 1.0f), "Retime Curve");
                m_CurveDrawer.OnPostGUI = OnCurveFieldGUI;
            }

            var useCurve             = serializedObject.FindProperty("useCurve");
            var outputSequenceLength = serializedObject.FindProperty("outputSequenceLength");

            EditorGUI.BeginChangeCheck();

            int length    = outputSequenceLength.intValue;
            int newlength = EditorGUILayout.IntSlider(VFXToolboxGUIUtility.Get("Sequence Length"), length, 1, inputSequenceLength);

            if (newlength != length)
            {
                outputSequenceLength.intValue = newlength;
            }

            EditorGUILayout.PropertyField(useCurve, VFXToolboxGUIUtility.Get("Use Retiming Curve"));

            if (useCurve.boolValue)
            {
                m_CurveDrawer.SetBounds(new Rect(0, 0, 1, inputSequenceLength - 1));

                if (m_CurveDrawer.OnGUILayout())
                {
                    changed = true;
                }
            }

            if (EditorGUI.EndChangeCheck())
            {
                changed = true;
            }

            return(changed);
        }