Beispiel #1
0
        static double DelayedAndDraggableDoubleField(Rect rect, GUIContent label, double value, ref InputEvent inputEvent, double dragSensitivity)
        {
            var id        = GUIUtility.GetControlID(FocusType.Keyboard);
            var fieldRect = EditorGUI.PrefixLabel(rect, id, label);

            rect.xMax = fieldRect.x;

            double refValue = value;
            long   dummy    = 0;

            inputEvent |= InputEventType(rect, id);

            EditorGUI.DragNumberValue(rect, id, true, ref refValue, ref dummy, dragSensitivity);

            EditorGUI.BeginChangeCheck();
            var result = EditorGUI.DelayedDoubleFieldInternal(fieldRect, GUIContent.none, refValue, EditorStyles.numberField);

            if (EditorGUI.EndChangeCheck())
            {
                inputEvent |= InputEvent.KeyboardInput;
            }

            return(result);
        }