How to make windows mouse behave like the ipad touchscreen

Hi

I have a missile that needs firing when the player presses the touchscreen on the ipad,
Below is the code that does that fine, problem is I’m developing the game on windows so would like the code to still work when running in the simulator. How can I map the mouse to pretend it’s the touchscreen so that when I’m developing the game I get a WYSIWYG type environment.

I need to add a load of code to the code below to add some functionality but to test it I have to keep converting it over to the Mac just to try it out on the ipad. Any ideas?

foreach(Touch touch in Input.touches)
  {
    if(touch.phase != TouchPhase.Ended && touch.phase != TouchPhase.Canceled)
    {
      fingercount++;
    }
    if(fingercount > 0)
    {
      fire();
    }
  }

I just wanted to toss this in here… When I was working on a game for the iPhone, I noticed that when you cast a ray

ray = Camera.main.ScreenPointToRay(Input.mousePosition);

the iPhone still detects the mousePosition as a fingerPosition. I don’t know if it’s a bug or they meant for it to happen that way, but you don’t really have the touch phases and fingercounts. So this made it very easy to test single taps for me, since that was all i needed. But if you need more things to happen and different fingertaps, then of course guyt’s answer is better. Not sure how to test for multiple fingertaps on the computer though, hah.

You should work with predefs.

What they do is compile some code only for specific build types and some to other build types.

For instance:

#if UNITY_IPHONE || UNITY_ANDROID
  foreach(Touch touch in Input.touches)
  {
    if(touch.phase != TouchPhase.Ended && touch.phase != TouchPhase.Canceled)
    {
      fingercount++;
    }
    if(fingercount > 0)
    {
      fire();
    }
  }
#else // Any build other then iphone or android
  if ( Input.GetMouseButton(0) )
   fire();
#endif