void ProcessFakeTouches ()
{
bool pressed = Input.GetMouseButtonDown(0);
bool unpressed = Input.GetMouseButtonUp(0);
bool held = Input.GetMouseButton(0);
if (pressed || unpressed || held)
{
currentTouchID = 1;
currentTouch = mMouse[0];
currentTouch.touchBegan = pressed;
if (pressed)
{
currentTouch.pressTime = RealTime.time;
activeTouches.Add(mMouse[0]);
}
Vector2 pos = Input.mousePosition;
currentTouch.delta = pressed ? Vector2.zero : pos - currentTouch.pos;
currentTouch.pos = pos;
// Raycast into the screen
if (!Raycast(currentTouch.pos)) hoveredObject = fallThrough;
if (hoveredObject == null) hoveredObject = mGenericHandler;
currentTouch.last = currentTouch.current;
currentTouch.current = hoveredObject;
lastTouchPosition = currentTouch.pos;
// We don't want to update the last camera while there is a touch happening
if (pressed) currentTouch.pressedCam = currentCamera;
else if (currentTouch.pressed != null) currentCamera = currentTouch.pressedCam;
// Process the events from this touch
ProcessTouch(pressed, unpressed);
// If the touch has ended, remove it from the list
if (unpressed) activeTouches.Remove(mMouse[0]);
currentTouch.last = null;
currentTouch = null;
}
}