Exemplo n.º 1
0
 //On up
 public override void OnPointerUp(PointerEventData eventData)
 {
     if (m_enabled)
     {
         base.OnPointerUp(eventData);
         CUIFunctions.PlayAction(m_onUp, this.gameObject);
     }
 }
Exemplo n.º 2
0
 public void SetValue(float value)
 {
     if(m_value > value)
         CUIFunctions.PlayAction(m_decreaseValue, this.gameObject);
     else if (m_value < value)
         CUIFunctions.PlayAction(m_increaseValue, this.gameObject);
     m_value = value;
     m_text.text = m_value.ToString(m_format);
 }
Exemplo n.º 3
0
 //Change by amount
 public void ChangeValue(float amount)
 {
     m_value += amount;
     if(amount > 0)
         CUIFunctions.PlayAction(m_increaseValue, this.gameObject);
     else if (amount < 0)
         CUIFunctions.PlayAction(m_decreaseValue, this.gameObject);
     m_text.text = m_value.ToString(m_format);
 }
Exemplo n.º 4
0
 //Enable
 public float Enable()
 {
     if (m_enabled == false)
     {
         m_enabled = true;
         gameObject.SetActive(true);
         return(CUIFunctions.PlayAction(m_onEnabled, this.gameObject));
     }
     return(0);
 }
Exemplo n.º 5
0
 //My disable function
 public float Disable()
 {
     if (m_enabled)
     {
         m_enabled = false;
         //Use return value from play actions being called to start coroutine
         float time = CUIFunctions.PlayAction(m_onDisabled, this.gameObject);
         StartCoroutine(CUIFunctions.DisableAfter(time, this.gameObject));
         return(time);
     }
     return(0);
 }
Exemplo n.º 6
0
 public void ChangeBy(float amount)
 {
     if (amount != 0)
     {
         m_lerpTimer = 0;
         if (amount > 0)
         {
             CUIFunctions.PlayAction(m_onIncrease, this.gameObject);
         }
         else
         {
             CUIFunctions.PlayAction(m_onDecrease, this.gameObject);
         }
         m_targetValue += amount;
     }
 }
Exemplo n.º 7
0
 public void SetValue(float value)
 {
     if (value != m_targetValue)
     {
         m_lerpTimer = 0;
         if (value > m_targetValue)
         {
             CUIFunctions.PlayAction(m_onIncrease, this.gameObject);
         }
         else
         {
             CUIFunctions.PlayAction(m_onDecrease, this.gameObject);
         }
         m_targetValue = value;
     }
     //StartCoroutine(LerpToOver(value, m_lerpTime));
 }