void OnApplicationPause ()
{
MouseOrTouch prev = currentTouch;
if (useTouch)
{
BetterList
<int> ids
= new BetterList
<int>();
foreach (KeyValuePair<int, MouseOrTouch> pair in mTouches)
{
if (pair.Value != null && pair.Value.pressed)
{
currentTouch = pair.Value;
currentTouchID = pair.Key;
currentScheme = ControlScheme.Touch;
currentTouch.clickNotification = ClickNotification.None;
ProcessTouch(false, true);
ids.Add(currentTouchID);
}
}
for (int i = 0; i < ids.size; ++i)
RemoveTouch(ids[i]);
}
if (useMouse)
{
for (int i = 0; i < 3; ++i)
{
if (mMouse[i].pressed)
{
currentTouch = mMouse[i];
currentTouchID = -1 - i;
currentKey = KeyCode.Mouse0 + i;
currentScheme = ControlScheme.Mouse;
currentTouch.clickNotification = ClickNotification.None;
ProcessTouch(false, true);
}
}
}
if (useController)
{
if (controller.pressed)
{
currentTouch = controller;
currentTouchID = -100;
currentScheme = ControlScheme.Controller;
currentTouch.last = currentTouch.current;
currentTouch.current = mCurrentSelection;
currentTouch.clickNotification = ClickNotification.None;
ProcessTouch(false, true);
currentTouch.last = null;
}
}
currentTouch = prev;
}