public void Start() { if (Parameter == null) { // parameter not defined > is it a component? Parameter = GetComponent <ParameterBase>(); } if (Parameter != null) { m_modify = (IParameterModify)Parameter; if (m_modify == null) { Debug.LogWarning("Parameter can't be modified"); this.enabled = false; } } else { Debug.LogWarning("Parameter not defined"); this.enabled = false; } m_handlerInc = InputHandler.Find(InputNameIncrease); m_handlerDec = InputHandler.Find(InputNameDecrease); }
private void ValueChanged(ParameterBase _parameter) { if (!m_updating) { m_updating = true; m_slider.value = (float)Warp(Parameter.MapTo01(Parameter.Value)); m_updating = false; } }
private void ValueChanged(ParameterBase _parameter) { if (!m_updating) { m_updating = true; m_toggle.isOn = Parameter.Value; m_updating = false; } }
private void ValueChanged(ParameterBase _parameter) { if (!m_updating) { m_updating = true; m_dropdown.value = Parameter.SelectedItemIndex; m_updating = false; } }
private void ValueChanged(ParameterBase _parameter) { if (!m_updating) { m_updating = true; // any visible changes here? m_updating = false; } }
private void ValueChanged(ParameterBase _parameter) { if (!m_updating) { m_updating = true; float fmin = (float)Warp(Parameter.MapTo01(Parameter.ValueMin)); minimumSlider.value = fmin; float fmax = (float)Warp(Parameter.MapTo01(Parameter.ValueMax)); maximumSlider.value = fmax; m_updating = false; } }
public string NumberFormat = "{0:0.0}...{1:0.0}"; // see https://msdn.microsoft.com/en-us/library/dwhawy9k(v=vs.110).aspx for formats public void Start() { if (Parameter == null) { // parameter not defined > is it a component? Parameter = GetComponent <ParameterBase>(); } if (Parameter != null) { Parameter.OnValueChanged += ValueChanged; } else { Debug.LogWarning("Parameter not defined"); this.enabled = false; } m_textComponent = GetComponent <Text>(); m_prefix = m_textComponent.text; }
public void Start() { if (Parameter == null) { Parameter = GetComponent <ParameterBase>(); } if (Parameter != null) { m_boolean = (IParameterAsBoolean)Parameter; if (m_boolean == null) { Debug.LogWarningFormat("Parameter '{0}' does not provide IParameterAsBoolean interface", Parameter.Name); this.enabled = false; } } else { Debug.LogWarning("Parameter not defined"); this.enabled = false; } m_handler = InputHandler.Find(InputName); }
public void Start() { if (Parameter == null) { Parameter = GetComponent <ParameterBase>(); } if (Parameter != null) { m_boolean = (IParameterAsBoolean)Parameter; if (m_boolean == null) { Debug.LogWarningFormat("Parameter '{0}' does not provide IParameterAsBoolean interface", Parameter.Name); this.enabled = false; } } else { Debug.LogWarning("Parameter not defined"); this.enabled = false; } if (this.enabled) { if (Action != null) { Action.action.performed += OnActionPerformed; Action.action.canceled += OnActionCanceled; Action.action.Enable(); } else { Debug.LogWarningFormat("Action not defined for parameter '{0}'", Parameter.Name); this.enabled = false; } } }
private void ValueChanged(ParameterBase _parameter) { m_textComponent.text = m_prefix + _parameter.ToFormattedString(NumberFormat); }