Exemplo n.º 1
0
        public override void OnMemberDrawn(Rect rect)
        {
            var drop = gui.RegisterFieldForDrop <UnityObject>(rect);

            if (drop != null)
            {
                memberValue = GetPath(drop);
            }

            var e = Event.current;

            if (e != null && rect.Contains(e.mousePosition))
            {
                if (Event.current.control && EventsHelper.IsMMBMouseDown())
                {
                    SelectionWindow.Show(new Tab <GameObject>(
                                             @getValues: Resources.FindObjectsOfTypeAll <GameObject>,
                                             @getCurrent: () => null,
                                             @setTarget: input => memberValue = GetPath(input),
                                             @getValueName: target => target.name,
                                             @title: "Objects"
                                             ));
                }
            }
        }