/// <summary> /// Changes the value of this input field without calling the callback /// </summary> /// <param name="baseValue">New value in the base unit type</param> /// <param name="context">Scenario element which indicates the edit input context</param> /// <param name="invokeApply">Should this method call invoke value apply callback</param> public void ExternalValueChange(float baseValue, ScenarioElement context, bool invokeApply) { if (Mathf.Approximately(currentValue, baseValue)) { return; } currentValue = baseValue; UnityInputField.SetTextWithoutNotify(ConvertFromBase(currentValue, currentUnit) .ToString(CultureInfo.CurrentCulture)); if (invokeApply) { valueApply?.Invoke(context, currentValue); } }
/// <summary> /// Unity OnDisable method /// </summary> private void OnDisable() { UnityInputField.OnDeselect(new BaseEventData(EventSystem.current)); }