Inheritance: MonoBehaviour
Exemplo n.º 1
0
 /// <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);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Unity OnDisable method
 /// </summary>
 private void OnDisable()
 {
     UnityInputField.OnDeselect(new BaseEventData(EventSystem.current));
 }