Is it possible to create a float field by using GUI.TextField?
I’m looking for exactly the same behavior as EditorGUI.FloatField, only have it work in the scene view.
I tried running the value from TextField, into the parse method and returning a float value, which sounds like it should work. However, it doesn’t. The issue is that I do this on every OnGUI, so when I enter a “.” (dot), the parse fails since 1. isn’t a float, while 1.x is. Copy-pasting a value into the field works, but typing it in doesn’t. Is there any way of accomplishing this or is there a link to repo somewhere that solved this? Here’s a simple snipper below.
float val = 0;
float.TryParse(GUI.TextField(floatRect, content.ToString()), out val);
return val;