예제 #1
0
        /**
         * <summary>Adds a UISlotClick component to the Button, which acts as a click-handler.</summary>
         * <param name = "_menu">The Menu that the Button is linked to</param>
         * <param name = "_element">The MenuElement within _menu that the Button is linked to</param>
         * <param name = "_slot">The index number of the slot within _element that the Button is linked to</param>
         */
        public void AddClickHandler(AC.Menu _menu, MenuElement _element, int _slot)
        {
            UISlotClick uiSlotClick = uiButton.gameObject.GetComponent <UISlotClick>();

            if (uiSlotClick == null)
            {
                uiSlotClick = uiButton.gameObject.AddComponent <UISlotClick>();
            }
            uiSlotClick.Setup(_menu, _element, _slot, true);
        }
예제 #2
0
파일: UISlot.cs 프로젝트: IJkeB/Ekster1
        public void AddClickHandler(AC.Menu _menu, MenuElement _element, int _slot)
        {
            UISlotClick uiSlotClick = uiButton.gameObject.AddComponent <UISlotClick>();

            uiSlotClick.Setup(_menu, _element, _slot);
        }