Ejemplo n.º 1
0
        internal override void OnHeaderTitleGUI(Rect titleRect, string header)
        {
            if (hasMultipleSelection)
            {
                base.OnHeaderTitleGUI(titleRect, m_MultiselectionHeaderTitle);
                return;
            }

            if (m_DisplayNameProperty != null)
            {
                using (new EditorGUI.DisabledScope(!IsEnabled()))
                {
                    serializedObject.Update();
                    if (IsLocked())
                    {
                        base.OnHeaderTitleGUI(titleRect, m_DisplayNameProperty.stringValue);
                    }
                    else
                    {
                        EditorGUI.BeginChangeCheck();
                        EditorGUI.DelayedTextField(titleRect, m_DisplayNameProperty, GUIContent.none);
                        if (EditorGUI.EndChangeCheck())
                        {
                            ApplyModifiedProperties();
                            TimelineWindow.RepaintIfEditingTimelineAsset(m_TimelineAsset);
                        }
                    }
                }
            }
        }
        public override void OnInspectorGUI()
        {
            base.get_serializedObject().Update();
            EditorGUI.BeginChangeCheck();
            EditorGUILayout.PropertyField(this.m_FrameRateProperty, TimelineAssetInspector.Styles.FrameRate, new GUILayoutOption[]
            {
                GUILayout.MinWidth(140f)
            });
            double num = Math.Max(this.m_FrameRateProperty.get_doubleValue(), TimeUtility.kFrameRateEpsilon);

            this.m_FrameRateProperty.set_doubleValue(num);
            double frameRate = num;

            EditorGUILayout.PropertyField(this.m_DurationModeProperty, TimelineAssetInspector.Styles.DurationMode, new GUILayoutOption[]
            {
                GUILayout.MinWidth(140f)
            });
            TimelineAsset.DurationMode enumValueIndex = (TimelineAsset.DurationMode) this.m_DurationModeProperty.get_enumValueIndex();
            if (enumValueIndex == TimelineAsset.DurationMode.FixedLength)
            {
                TimelineInspectorUtility.TimeField(this.m_FixedDurationProperty, TimelineAssetInspector.Styles.Duration, false, frameRate, 4.94065645841247E-324, TimelineClip.kMaxTimeValue * 2.0);
            }
            else
            {
                bool showMixed = base.get_targets().Length > 1;
                TimelineInspectorUtility.TimeField(TimelineAssetInspector.Styles.Duration, ((TimelineAsset)base.get_target()).get_duration(), true, showMixed, frameRate, -1.7976931348623157E+308, 1.7976931348623157E+308);
            }
            bool flag = EditorGUI.EndChangeCheck();

            base.get_serializedObject().ApplyModifiedProperties();
            if (flag)
            {
                TimelineWindow.RepaintIfEditingTimelineAsset((TimelineAsset)base.get_target());
            }
        }
Ejemplo n.º 3
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            EditorGUI.BeginChangeCheck();

            EditorGUILayout.PropertyField(m_FrameRateProperty, Styles.FrameRate, GUILayout.MinWidth(140));
            var frameRate = m_FrameRateProperty.doubleValue;

            EditorGUILayout.PropertyField(m_DurationModeProperty, Styles.DurationMode, GUILayout.MinWidth(140));

            var durationMode = (TimelineAsset.DurationMode)m_DurationModeProperty.enumValueIndex;
            var inputEvent   = InputEvent.None;

            if (durationMode == TimelineAsset.DurationMode.FixedLength)
            {
                TimelineInspectorUtility.TimeField(m_FixedDurationProperty, Styles.Duration, false, frameRate, double.Epsilon, TimelineClip.kMaxTimeValue * 2, ref inputEvent);
            }
            else
            {
                var isMixed = targets.Length > 1;
                TimelineInspectorUtility.TimeField(Styles.Duration, ((TimelineAsset)target).duration, true, isMixed, frameRate, double.MinValue, double.MaxValue, ref inputEvent);
            }

            bool changed = EditorGUI.EndChangeCheck();

            serializedObject.ApplyModifiedProperties();

            if (changed)
            {
                TimelineWindow.RepaintIfEditingTimelineAsset((TimelineAsset)target);
            }
        }
Ejemplo n.º 4
0
        void DrawBlendOptions()
        {
            EditorGUI.BeginChangeCheck();

            DrawBlendCurve(Styles.BlendInCurveName, m_BlendInCurveModeProperty, m_MixInCurveProperty, x => OnMixCurveSelected("Blend In", BuiltInPresets.blendInPresets, x, true));
            DrawBlendCurve(Styles.BlendOutCurveName, m_BlendOutCurveModeProperty, m_MixOutCurveProperty, x => OnMixCurveSelected("Blend Out", BuiltInPresets.blendOutPresets, x, false));

            if (EditorGUI.EndChangeCheck())
            {
                TimelineWindow.RepaintIfEditingTimelineAsset(m_TimelineAsset);
            }
        }
Ejemplo n.º 5
0
 private void DrawBlendOptions()
 {
     EditorGUI.BeginChangeCheck();
     this.DrawBlendCurve(ClipInspector.Styles.BlendInCurveName, this.m_BlendInCurveModeProperty, this.m_MixInCurveProperty, delegate(SerializedProperty x)
     {
         this.OnMixCurveSelected("Blend In", BuiltInPresets.blendInPresets, x, true);
     });
     this.DrawBlendCurve(ClipInspector.Styles.BlendOutCurveName, this.m_BlendOutCurveModeProperty, this.m_MixOutCurveProperty, delegate(SerializedProperty x)
     {
         this.OnMixCurveSelected("Blend Out", BuiltInPresets.blendOutPresets, x, false);
     });
     if (EditorGUI.EndChangeCheck())
     {
         TimelineWindow.RepaintIfEditingTimelineAsset(this.m_TimelineAsset);
     }
 }
Ejemplo n.º 6
0
 internal override void OnHeaderTitleGUI(Rect titleRect, string header)
 {
     if (this.hasMultipleSelection)
     {
         base.OnHeaderTitleGUI(titleRect, this.m_MultiselectionHeaderTitle);
     }
     else if (this.m_DisplayNameProperty != null)
     {
         base.get_serializedObject().Update();
         EditorGUI.BeginChangeCheck();
         EditorGUI.DelayedTextField(titleRect, this.m_DisplayNameProperty, GUIContent.none);
         if (EditorGUI.EndChangeCheck())
         {
             this.ApplyModifiedProperties();
             TimelineWindow.RepaintIfEditingTimelineAsset(this.m_TimelineAsset);
         }
     }
 }
Ejemplo n.º 7
0
 void RefreshCurves()
 {
     AnimationCurvePreviewCache.ClearCache();
     TimelineWindow.RepaintIfEditingTimelineAsset(m_TimelineAsset);
     Repaint();
 }