public static int IntTextField(ref int value, String name = null, params GUILayoutOption[] options) { String text = $"{value}"; UI.TextField(ref text, name, options); Int32.TryParse(text, out value); return(value); }
public static float FloatTextField(ref float value, String name = null, params GUILayoutOption[] options) { String text = $"{value}"; UI.TextField(ref text, name, options); var val = value; if (float.TryParse(text, out val)) { value = val; } return(value); }