Beispiel #1
0
    public void OnPointerClick(PointerEventData eventData)
    {
        //button stays in the selected state when clicked

        if (active)
        {
            if (currState != ButtonState.Selected) //it if isn't selected equip it
            {
                currState = ButtonState.Selected;
                itemDescription.Equip();
            }
            else //unequip it
            {
                currState = ButtonState.Hover;
                itemDescription.Unequip();
            }

            ButtonUpdate();
        }
    }