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());
            }
        }
        static void SelectDurationCallback(WindowState state, TimelineAsset.DurationMode mode)
        {
            // if we switched from Auto to Fixed, use the auto duration as the new fixed duration so the end marker stay in the same position.
            if (state.editSequence.asset.durationMode == TimelineAsset.DurationMode.BasedOnClips && mode == TimelineAsset.DurationMode.FixedLength)
            {
                state.editSequence.asset.fixedDuration = state.editSequence.duration;
            }

            state.editSequence.asset.durationMode = mode;
        }
Esempio n. 3
0
        static void SelectDurationCallback(WindowState state, TimelineAsset.DurationMode mode)
        {
            if (mode == state.editSequence.asset.durationMode)
            {
                return;
            }

            TimelineUndo.PushUndo(state.editSequence.asset, "Duration Mode");


            // if we switched from Auto to Fixed, use the auto duration as the new fixed duration so the end marker stay in the same position.
            if (state.editSequence.asset.durationMode == TimelineAsset.DurationMode.BasedOnClips && mode == TimelineAsset.DurationMode.FixedLength)
            {
                state.editSequence.asset.fixedDuration = state.editSequence.duration;
            }

            state.editSequence.asset.durationMode = mode;
            state.UpdateRootPlayableDuration(state.editSequence.duration);
        }