private static bool OnGlobalMouseOrKeyEvent(EventType type, KeyCode keyCode, Vector2 mousePosition)
{
if (s_PopupWindowWithoutFocus != null)
{
if ((type == EventType.KeyDown) && (keyCode == KeyCode.Escape))
{
s_PopupWindowWithoutFocus.Close();
return true;
}
if ((type == EventType.MouseDown) && !s_PopupWindowWithoutFocus.position.Contains(mousePosition))
{
s_PopupWindowWithoutFocus.Close();
return true;
}
}
return false;
}