title: What's the best way to make a number picker with arrows?
body: <p>I want to make a number picker that looks like this to input any number from 0 to 99.</p>
  <p><a href="https://i.stack.imgur.com/Nsz0o.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Nsz0o.png" alt="enter image description here" /></a></p>
  <p>My code so far looks like this (where leftDigit and rightDigit are the Text components in Unity that change with every arrow key hit). I linked this function to all four arrow buttons and gave them 10, -10, 1, -1 as parameters respectively to update the inputNumber in my script.</p>
  <pre><code>public void UpdateUINumber(int value)
  {
      if (inputNumber + value &gt;= 0)
      {
          inputNumber += value;
          if (Mathf.Abs(value) == 1 &amp;&amp; (inputNumber / 10) != int.Parse(leftDigit.text))
              inputNumber -= value * 10;
          leftDigit.text = ((inputNumber / 10) % 10).ToString();
          rightDigit.text = (inputNumber % 10).ToString();
      }
  }
  </code></pre>
  <p>However I have a feeling my code could be even more compact and elegant. I really want to keep the single UpdateUINumber function linked to all 4 buttons.
  Do you have any idea about how I could upgrade this function with maybe arithmetics involved? Thanks a lot</p>