Exemple #1
0
    public void OnPointerClick(PointerEventData eventData)
    {
        if (eventData.button == PointerEventData.InputButton.Left)
        {
#if UNITY_STANDALONE
            if (holder)
            {
                holder.OnMouseClick?.Invoke();
            }
#elif UNITY_ANDROID
            if (holder)
            {
                holder.OnFingerClick?.Invoke();
            }
            if (!string.IsNullOrEmpty(TextToDisplay))
            {
                tips = WindowsManager.OpenWindowBy <FloatTipsPanel>(transform.position, TextToDisplay, 2, false);
                if (tips)
                {
                    tips.onClose += () => tips = null;
                }
            }
#endif
        }
        if (eventData.button == PointerEventData.InputButton.Right)
        {
            OnRightClick();
        }
    }
Exemple #2
0
    private void ShowNameAtMousePosition()
    {
        int time = -1;

#if UNITY_ANDROID
        time = 2;
#endif
        FloatTipsPanel.ShowText(InputManager.mousePosition, GetMapIconName(), time);
    }
    public void OnPointerClick(PointerEventData eventData)
    {
#if UNITY_ANDROID
        if (!string.IsNullOrEmpty(infoToShow))
        {
            if (!autoHide)
            {
                FloatTipsPanel.ShowText(transform.position, infoToShow, closeBtn: true);
            }
            else
            {
                FloatTipsPanel.ShowText(transform.position, infoToShow, hideDelay);
            }
        }
#endif
    }
    public void OnPointerClick(PointerEventData eventData)
    {
        if (eventData.button == PointerEventData.InputButton.Left)
        {
#if UNITY_STANDARD
            if (DragableManager.Instance.IsDraging)
            {
                ItemSlotAgent source = DragableManager.Instance.Current as ItemSlotAgent;
                if (source)
                {
                    InventoryUtility.DiscardItem(Window.Handler, source.Item);
                    source.FinishDrag();
                }
            }
            else
            {
                OpenDiscardWindow();
            }
#elif UNITY_ANDROID
            OpenDiscardWindow();
            FloatTipsPanel.ShowText(transform.position, "将物品拖拽到此按钮丢弃,或者点击该按钮进行多选。", 3);
#endif
        }
    }