예제 #1
0
        protected void OnReceivedOSC_Data(OSC_Variable var)
        {
            if (!m_updating)
            {
                m_updating = true;
                if (m_indexVar.Value < 0.1f)
                {
                    // value < 0: select previous item
                    m_dropdown.value--;
                }
                else if ((m_indexVar.Value > 0.1f) && (m_indexVar.Value < 0.9f))
                {
                    // value >0 < 1: select next item
                    m_dropdown.value++;
                }
                else if (m_indexVar.Value >= 0)
                {
                    // value > 0: select item directly
                    m_dropdown.value = (int)m_indexVar.Value;
                }

                m_labelVar.Value = m_dropdown.options[m_dropdown.value].text;
                m_labelVar.SendUpdate();

                m_updating = false;
            }
        }
예제 #2
0
 protected void OnReceivedOSC_Data(OSC_Variable var)
 {
     if (!m_updating)
     {
         m_updating = true;
         SetParameterValue(m_variable.Value);
         m_updating = false;
     }
 }
 protected void OnReceivedOSC_Data(OSC_Variable var)
 {
     if (!m_updating)
     {
         m_updating     = true;
         m_slider.value = m_variable.Value;
         m_updating     = false;
     }
 }
예제 #4
0
 protected void OnReceivedOSC_Data(OSC_Variable var)
 {
     if (!m_updating)
     {
         m_updating = true;
         if (m_variable.Value)
         {
             m_button.onClick.Invoke();
         }
         m_updating = false;
     }
 }
        protected void OnReceivedOSC_Data_Index(OSC_Variable var)
        {
            if (!m_updating)
            {
                // prevent recursion
                m_updating = true;

                // select index directly
                m_parameter.SelectedItemIndex = (int)m_indexVariable.Value;
                // update label
                m_labelVariable.Value = m_parameter.SelectedItem.text;
                m_labelVariable.SendUpdate();

                m_updating = false;
            }
        }
        protected void OnReceivedOSC_Data_Delta(OSC_Variable var)
        {
            if (!m_updating)
            {
                // prevent recursion
                m_updating = true;

                // apply delta to index
                m_parameter.SelectedItemIndex += m_deltaVariable.Value;
                // update label
                m_indexVariable.Value = m_parameter.SelectedItemIndex;
                m_labelVariable.Value = m_parameter.SelectedItem.text;
                m_indexVariable.SendUpdate();
                m_labelVariable.SendUpdate();

                m_updating = false;
            }
        }