protected override void OnEditorPrefGUI(Rect position, GUIContent label) { BeginBlock(metadata, position); T newValue; var fieldPosition = new Rect ( position.x, position.y, position.width, EditorGUIUtility.singleLineHeight - 2 ); if (metadata.HasAttribute <InspectorRangeAttribute>()) { var rangeAttribute = metadata.GetAttribute <InspectorRangeAttribute>(); newValue = (T)Convert.ChangeType(EditorGUI.Slider(fieldPosition, label, Convert.ToSingle(metadata.value), rangeAttribute.min, rangeAttribute.max), typeof(T)); } else { if (Is64Bits(metadata.value)) { newValue = (T)Convert.ChangeType(LudiqGUI.DraggableLongField(fieldPosition, Convert.ToInt64(metadata.value), label), typeof(T)); } else { newValue = (T)Convert.ChangeType(LudiqGUI.DraggableFloatField(fieldPosition, Convert.ToSingle(metadata.value), label), typeof(T)); } } if (EndBlock(metadata)) { metadata.RecordUndo(); metadata.value = newValue; } }