public static GetPickedColor ( ) : |
||
Résultat |
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); } }
private void OnGUI() { switch (Event.current.type) { case EventType.MouseDown: if (Event.current.button == 0) { EyeDropper.s_PickCoordinates = GUIUtility.GUIToScreenPoint(Event.current.mousePosition); base.window.Close(); EyeDropper.s_LastPickedColor = EyeDropper.GetPickedColor(); this.SendEvent("EyeDropperClicked"); } break; case EventType.MouseMove: EyeDropper.s_PickCoordinates = GUIUtility.GUIToScreenPoint(Event.current.mousePosition); base.StealMouseCapture(); this.SendEvent("EyeDropperUpdate"); break; case EventType.KeyDown: if (Event.current.keyCode == KeyCode.Escape) { base.window.Close(); this.SendEvent("EyeDropperCancelled"); } break; } }