예제 #1
0
    // Update is called once per frame
    void Update()
    {
        PointerEventData ped = new PointerEventData(EventSystem.current);

        ped.position = Input.mousePosition;
        FindHovering <MercSlot>(out hoveringSlot, ped);
        FindHovering <MercTrayElement>(out hoveringElement, ped);

        if (dragging != null)
        {
            dragging.updatePositionToMouse();
        }

        if (hoveringElement != null)
        {
            bool overrideBindingPressed = Input.GetKey(overrideBinding);
            if (overrideBindingPressed)
            {
                KeyCode pressed = BindingHandler.getAnyPressed();
                if (pressed != KeyCode.None)
                {
                    BindingHandler.addBind(pressed, hoveringElement);
                }
            }
        }

        if (hoveringSlot != null)
        {
            foreach (MercTrayElement e in BindingHandler.getTriggeredElements())
            {
                if (e.waiting != null)
                {
                    e.waiting.Trigger(hoveringSlot);
                }
            }
        }
    }