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.
if (Time.time >= nextAttackTime)
{
if (Input.GetKeyDown(KeyCode.Space))
{
Attack();
nextAttackTime = Time.time + 2.5f / attackRate;
}
}