UnityEditor.EyeDropper.GetPickedColor C# (CSharp) Method

GetPickedColor() public static method

public static GetPickedColor ( ) : Color
return UnityEngine.Color
        public static Color GetPickedColor()
        {
            return InternalEditorUtility.ReadScreenPixel(s_PickCoordinates, 1, 1)[0];
        }

Usage Example

示例#1
0
        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);
            }
        }
All Usage Examples Of UnityEditor.EyeDropper::GetPickedColor