Beispiel #1
0
    public void OnPointerDown(PointerEventData eventData)
    {
        if (isDisabled || hasSubmenu)
        {
            return;
        }

        if (isSubmenuItem)
        {
            parentItem.CloseSubMenu();
        }
        parentMenu.CloseMenu();
        image.color = defaultColor;
        callback.Invoke();
    }
    public void OnPointerEnter(PointerEventData eventData)
    {
        if (isSelected)
        {
            return;
        }

        if (isMenuOpen)
        {
            currentOpenMenu.CloseMenu();
            OpenMenu();
            currentOpenMenu = this;
        }
        else
        {
            image.color = hoverColor;
        }
    }