private void OnGUI()
{
EventType type = Event.current.type;
if (type != EventType.MouseMove)
{
if (type != EventType.MouseDown)
{
if (type == EventType.KeyDown)
{
if (Event.current.keyCode == KeyCode.Escape)
{
base.window.Close();
this.SendEvent("EyeDropperCancelled", true);
}
}
}
else if (Event.current.button == 0)
{
EyeDropper.s_PickCoordinates = GUIUtility.GUIToScreenPoint(Event.current.mousePosition);
base.window.Close();
EyeDropper.s_LastPickedColor = EyeDropper.GetPickedColor();
this.SendEvent("EyeDropperClicked", true);
}
}
else
{
EyeDropper.s_PickCoordinates = GUIUtility.GUIToScreenPoint(Event.current.mousePosition);
base.StealMouseCapture();
this.SendEvent("EyeDropperUpdate", true);
}
}