diff options
| author | Andrew Lee <alee14498@protonmail.com> | 2020-08-20 23:40:50 -0400 |
|---|---|---|
| committer | Andrew Lee <alee14498@protonmail.com> | 2020-08-20 23:40:50 -0400 |
| commit | 3af4c218c0e70167db23a6303d2af30aff37d2fe (patch) | |
| tree | 927f29edcf54ab562f40f3d1c6cb69287c7f5980 /Library/PackageCache/com.unity.timeline@1.2.13/Editor/inspectors/TimeFieldDrawer.cs | |
| parent | b6daed0af784f4e9bc13329dd87c671b06ee1c65 (diff) | |
| download | Project-Sandbox-3af4c218c0e70167db23a6303d2af30aff37d2fe.tar.gz Project-Sandbox-3af4c218c0e70167db23a6303d2af30aff37d2fe.tar.bz2 Project-Sandbox-3af4c218c0e70167db23a6303d2af30aff37d2fe.zip | |
Removed a bunch of stuff; Changes
Diffstat (limited to 'Library/PackageCache/com.unity.timeline@1.2.13/Editor/inspectors/TimeFieldDrawer.cs')
| -rw-r--r-- | Library/PackageCache/com.unity.timeline@1.2.13/Editor/inspectors/TimeFieldDrawer.cs | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/Library/PackageCache/com.unity.timeline@1.2.13/Editor/inspectors/TimeFieldDrawer.cs b/Library/PackageCache/com.unity.timeline@1.2.13/Editor/inspectors/TimeFieldDrawer.cs deleted file mode 100644 index 622f5b4..0000000 --- a/Library/PackageCache/com.unity.timeline@1.2.13/Editor/inspectors/TimeFieldDrawer.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System; -using System.Linq; -using UnityEngine; -using UnityEngine.Timeline; - -namespace UnityEditor.Timeline -{ - [CustomPropertyDrawer(typeof(TimeFieldAttribute), true)] - class TimeFieldDrawer : PropertyDrawer - { - static WindowState state - { - get { return TimelineWindow.instance != null ? TimelineWindow.instance.state : null; } - } - - static float currentFrameRate - { - get { return state != null ? TimelineWindow.instance.state.referenceSequence.frameRate : 0.0f; } - } - - public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) - { - if (property.propertyType != SerializedPropertyType.Float) - { - GUILayout.Label("TimeField only works on floating point types"); - return; - } - - var timeFieldAttribute = attribute as TimeFieldAttribute; - if (timeFieldAttribute == null) - return; - - var rect = EditorGUILayout.s_LastRect; - EditorGUI.BeginChangeCheck(); - - if (timeFieldAttribute.useEditMode == TimeFieldAttribute.UseEditMode.ApplyEditMode) - TimeFieldWithEditMode(rect, property, label); - else - TimeField(rect, property, label); - - if (EditorGUI.EndChangeCheck()) - { - if (state != null) - state.Refresh(); - } - } - - static void TimeField(Rect rect, SerializedProperty property, GUIContent label) - { - var evt1 = InputEvent.None; - TimelineInspectorUtility.TimeField(rect, property, label, false, currentFrameRate, 0, float.MaxValue, ref evt1); - } - - static void TimeFieldWithEditMode(Rect rect, SerializedProperty property, GUIContent label) - { - double minStartTime; - if (property.hasMultipleDifferentValues) - minStartTime = SelectionManager.SelectedItems().Min(i => i.start); - else - minStartTime = property.doubleValue; - - var evt = InputEvent.None; - var newValue = TimelineInspectorUtility.TimeField( - rect, label, minStartTime, false, property.hasMultipleDifferentValues, currentFrameRate, 0.0, float.MaxValue, ref evt); - - EditMode.inputHandler.ProcessMove(evt, newValue); - } - } -} |
