- Home /
Drag editing on a EditorGUILayout.FloatField
I'm using a EditorGUILayout.FloatField with a label in a custom Editor, which works correctly when the user types the value in the box (in my case, it triggers a Repaint call to show the float value in the Scene view).
However, the same FloatField does not work when the user places the mouse cursor over the label and drags left/right to increase/decrease the value in the field: the value in the inspector changes correctly, but it does not trigger a Repaint (and thus fails to show the updated value in the Scene view).
I'm currently learning how to implement custom inspectors in the Editor, so I'm probably missing something; here is the code called inside the OnInspectorGUI method for the float field:
EditorGUI.BeginChangeCheck();
var f = EditorGUILayout.FloatField("Position on Curve", t);
if (EditorGUI.EndChangeCheck())
{
this.t = f;
inspector.Repaint();
}
Please let me know if I should add some context and/or a few screenshots of what I'm trying to do.
Answer by IgorAherne · Dec 27, 2016 at 04:17 PM
Are you looking for something like
if(GUI.changed){
SceneView.RepaintAll()
}
Chaning using SceneView.RepaintAll ins$$anonymous$$d of Repaint did work, thank you!
Your answer
![](https://koobas.hobune.stream/wayback/20220612103527im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Why isn't there an overload method for EditorGUILayout.Toggle to toggleOnLabelClick? 1 Answer
Unity editor extension - create drag and drop (similar to Buildbox) 1 Answer
Custom inspector difficulties creating a Box / Group like widget 1 Answer
Custom Inspector for a List ? 2 Answers
Finding a GameObject in an editor script based on position 2 Answers