private bool OnValueChanged(BoundInputField source, string input) { float value; if (float.TryParse(input, out value)) { Rect val = (Rect)Value; if (source == inputX) { val.x = value; } else if (source == inputY) { val.y = value; } else if (source == inputW) { val.width = value; } else { val.height = value; } Value = val; return(true); } return(false); }
private bool OnValueChanged(BoundInputField source, string input) { float value; if (float.TryParse(input, out value)) { Vector3 val = (Vector3)Value; if (source == inputX) { val.x = value; } else if (source == inputY) { val.y = value; } else { val.z = value; } Value = val; return(true); } return(false); }
private bool OnRGBAChanged(BoundInputField source, string input) { byte value; if (byte.TryParse(input, out value)) { Color32 color = colorWheel.Color; if (source == rInput) { color.r = value; } else if (source == gInput) { color.g = value; } else if (source == bInput) { color.b = value; } else { color.a = value; alphaSlider.Value = value / 255f; } alphaSlider.Color = color; colorWheel.PickColor(color); return(true); } return(false); }
private bool OnValueSubmitted(BoundInputField source, string input) { if (m_setterMode == Mode.OnSubmit) { Value = input; } return(true); }
private bool OnValueChanged(BoundInputField source, string input) { float value; if (float.TryParse(input, out value)) { if (isQuaternion) { Quaternion val = (Quaternion)Value; if (source == inputX) { val.x = value; } else if (source == inputY) { val.y = value; } else if (source == inputZ) { val.z = value; } else { val.w = value; } Value = val; } else { Vector4 val = (Vector4)Value; if (source == inputX) { val.x = value; } else if (source == inputY) { val.y = value; } else if (source == inputZ) { val.z = value; } else { val.w = value; } Value = val; } return(true); } return(false); }
private bool OnValueSubmitted(BoundInputField source, string input) { if (m_setterMode == Mode.OnSubmit) { Value = input; } Inspector.RefreshDelayed(); return(true); }
private bool OnSizeInputBeingChanged(BoundInputField source, string input) { int value; if (int.TryParse(input, NumberStyles.Integer, RuntimeInspectorUtils.numberFormat, out value) && value >= 0) { return(true); } return(false); }
private bool OnSizeInputBeingChanged(BoundInputField source, string input) { int value; if (int.TryParse(input, out value) && value >= 0) { return(true); } return(false); }
protected virtual bool OnValueChanged(BoundInputField source, string input) { object value; if (numberHandler.TryParse(input, out value)) { Value = value; return(true); } return(false); }
private bool OnValueChanged(BoundInputField source, string input) { #if UNITY_2017_2_OR_NEWER if (isVector3Int) { int value; if (int.TryParse(input, NumberStyles.Integer, RuntimeInspectorUtils.numberFormat, out value)) { Vector3Int val = (Vector3Int)Value; if (source == inputX) { val.x = value; } else if (source == inputY) { val.y = value; } else { val.z = value; } Value = val; return(true); } } else #endif { float value; if (float.TryParse(input, NumberStyles.Float, RuntimeInspectorUtils.numberFormat, out value)) { Vector3 val = (Vector3)Value; if (source == inputX) { val.x = value; } else if (source == inputY) { val.y = value; } else { val.z = value; } Value = val; return(true); } } return(false); }
private bool OnValueChanged(BoundInputField source, string input) { object value; if (parser.TryParse(input, out value)) { Value = value; return(true); } return(false); }
protected override bool OnValueChanged(BoundInputField source, string input) { object value; if (numberHandler.TryParse(input, out value)) { float fvalue = numberHandler.ConvertToFloat(value); if (fvalue >= slider.BackingField.minValue && fvalue <= slider.BackingField.maxValue) { Value = value; return(true); } } return(false); }
private bool OnValueChanged(BoundInputField source, string input) { #if UNITY_2017_2_OR_NEWER if (isVector2Int) { int value; if (int.TryParse(input, out value)) { Vector2Int val = (Vector2Int)Value; if (source == inputX) { val.x = value; } else { val.y = value; } Value = val; return(true); } } else #endif { float value; if (float.TryParse(input, out value)) { Vector2 val = (Vector2)Value; if (source == inputX) { val.x = value; } else { val.y = value; } Value = val; return(true); } } return(false); }
private bool OnValueSubmitted(BoundInputField source, string input) { Inspector.RefreshDelayed(); return(OnValueChanged(source, input)); }
private bool OnValueChanged(BoundInputField source, string input) { #if UNITY_2017_2_OR_NEWER if (isRectInt) { int value; if (int.TryParse(input, out value)) { RectInt val = (RectInt)Value; if (source == inputX) { val.x = value; } else if (source == inputY) { val.y = value; } else if (source == inputW) { val.width = value; } else { val.height = value; } Value = val; return(true); } } else #endif { float value; if (float.TryParse(input, out value)) { Rect val = (Rect)Value; if (source == inputX) { val.x = value; } else if (source == inputY) { val.y = value; } else if (source == inputW) { val.width = value; } else { val.height = value; } Value = val; return(true); } } return(false); }
private bool OnSizeChanged(BoundInputField source, string input) { int value; if (int.TryParse(input, NumberStyles.Integer, RuntimeInspectorUtils.numberFormat, out value) && value >= 0) { int currLength = Length; if (currLength != value) { if (isArray) { Array array = (Array)Value; Array newArray = Array.CreateInstance(BoundVariableType.GetElementType(), value); if (value > currLength) { if (array != null) { Array.ConstrainedCopy(array, 0, newArray, 0, currLength); } for (int i = currLength; i < value; i++) { object template = GetTemplateElement(array); if (template != null) { newArray.SetValue(template, i); } } } else { Array.ConstrainedCopy(array, 0, newArray, 0, value); } Value = newArray; } else { IList list = (IList)Value; int deltaLength = value - currLength; if (deltaLength > 0) { if (list == null) { list = (IList)Activator.CreateInstance(typeof(List <>).MakeGenericType(BoundVariableType.GetGenericArguments()[0])); } for (int i = 0; i < deltaLength; i++) { list.Add(GetTemplateElement(list)); } } else { for (int i = 0; i > deltaLength; i--) { list.RemoveAt(list.Count - 1); } } Value = list; } Inspector.RefreshDelayed(); } return(true); } return(false); }
private bool OnValueChanged(BoundInputField source, string input) { Value = input; return(true); }