private static void AddDistanceSetting(UIHelper group) { UITextField distanceField = null; distanceField = group.AddTextfield(Localize.Settings_RenderDistance, RenderDistance.ToString(), OnDistanceChanged, OnDistanceSubmitted) as UITextField; void OnDistanceChanged(string distance) { } void OnDistanceSubmitted(string text) { if (float.TryParse(text, out float distance)) { if (distance < 0) { distance = 300; } RenderDistance.value = distance; distanceField.text = distance.ToString(); } else { distanceField.text = RenderDistance.ToString(); } } }
void OnDistanceSubmitted(string text) { if (float.TryParse(text, out float distance)) { if (distance < 0) { distance = 300; } RenderDistance.value = distance; distanceField.text = distance.ToString(); } else { distanceField.text = RenderDistance.ToString(); } }
private static void AddDistanceSetting(UIHelper group) { UITextField distanceField = null; distanceField = group.AddTextfield(Localize.Settings_RenderDistance, RenderDistance.ToString(), OnDistanceChanged, OnDistanceSubmitted) as UITextField;