Current script, I am trying to add a touch feature to add money.
public class AddReducePlayerMoney : MonoBehaviour
{
public int money;
public GameObject cam;
void Update()
{
Touch myTouch = Input.GetTouch(1);
Touch[] myTouches = Input.touches;
for(int i = 1; i < Input.touchCount; i++)
{
if (Input.GetButtonDown("Fire1"))
{
cam.GetComponent<PlayerMoney>().addMoney(5);
}
if (Input.GetButtonDown("Fire2"))
{
cam.GetComponent<PlayerMoney>().subtractMoney(5);
}
}
}
}