Well,
I've added this :
if (unpressed)
{
Debug.Log ("Unpressed 1");
if (mTooltip != null) ShowTooltip(false);
if (currentTouch.pressed != null)
{
currentTouch.pressed.SendMessage("OnPress", false, SendMessageOptions.DontRequireReceiver);
Debug.Log ("Unpressed 2");
// Send a hover message to the object, but don't add it to the list of hovered items as it's already present
// This happens when the mouse is released over the same button it was pressed on, and since it already had
// its 'OnHover' event, it never got Highlight(false), so we simply re-notify it so it can update the visible state.
if (useMouse && currentTouch.pressed == mHover) currentTouch.pressed.SendMessage("OnHover", true, SendMessageOptions.DontRequireReceiver);
// If the button/touch was released on the same object, consider it a click and select it
if (currentTouch.pressed == currentTouch.current)
{
Debug.Log ("Unpressed 3");
if (currentTouch.pressed != mSel)
{
mSel = currentTouch.pressed;
currentTouch.pressed.SendMessage("OnSelect", true, SendMessageOptions.DontRequireReceiver);
}
else
{
mSel = currentTouch.pressed;
}
// If the touch should consider clicks, send out an OnClick notification
if (currentTouch.clickNotification != ClickNotification.None)
{
Debug.Log ("Unpressed 4");
float time = Time.realtimeSinceStartup;
currentTouch.pressed.SendMessage("OnClick", SendMessageOptions.DontRequireReceiver);
if (currentTouch.clickTime + 0.25f > time)
{
Debug.Log ("Unpressed 5");
currentTouch.pressed.SendMessage("OnDoubleClick", SendMessageOptions.DontRequireReceiver);
}
currentTouch.clickTime = time;
}
}
else // The button/touch was released on a different object
{
Debug.Log ("Unpressed 6");
// Send a drop notification (for drag & drop)
if (currentTouch.current != null) currentTouch.current.SendMessage("OnDrop", currentTouch.pressed, SendMessageOptions.DontRequireReceiver);
}
}
currentTouch.pressed = null;
}
When i make a double tap on an item in a UIGrid I see "Unpressed 1", "Unpressed 2", "Unpressed 3" or "Unpressed 4" but never "Unpressed 5" which should raise OnDoubleClick.
Any idea?