title: Unity 2D How to set touch button?
body: <p>I make a game for android and i need to have UI Joystick and UI Attack Button on the game screen. I already have the workable Joystick and Attack Button on Space key for keyboard.
  Can someone told me how should i switch code from keyboard Input to Touch Input?
  P.S. i'm sorry for my english.</p>
  <pre><code>        if (Time.time &gt;= nextAttackTime)
      {
          if (Input.GetKeyDown(KeyCode.Space))
          {
              Attack();
              nextAttackTime = Time.time + 2.5f / attackRate;
          }
      }
  </code></pre>