Example #1
0
        public new void OnPointerEnter(PointerEventData eventData)
        {
            base.OnPointerEnter(eventData);
            try
            {
                var item = PlayerManager.LocalPlayerScript?.DynamicItemStorage?.GetActiveHandSlot().Item;
                if (item == null ||
                    itemSlot.Item != null ||
                    itemSlot.NamedSlot == NamedSlot.rightHand ||
                    itemSlot.NamedSlot == NamedSlot.leftHand)
                {
                    return;
                }

                itemSlot.UpdateImage(item.gameObject,
                                     Validations.CanPutItemToSlot(PlayerManager.LocalPlayerScript, itemSlot.ItemSlot, item,
                                                                  NetworkSide.Client)
                                                ? successOverlayColor
                                                : failOverlayColor);
            }
            catch (NullReferenceException exception)
            {
                Logger.LogError($"Caught an NRE in UI_ItemSLot.OnPointerEnter() {exception.Message} \n {exception.StackTrace}", Category.UI);
            }
        }
Example #2
0
        public new void OnPointerEnter(PointerEventData eventData)
        {
            base.OnPointerEnter(eventData);

            var item = PlayerManager.LocalPlayerScript?.DynamicItemStorage?.GetActiveHandSlot().Item;

            if (item == null ||
                itemSlot.Item != null ||
                itemSlot.NamedSlot == NamedSlot.rightHand ||
                itemSlot.NamedSlot == NamedSlot.leftHand)
            {
                return;
            }
            itemSlot.UpdateImage(item.gameObject,
                                 Validations.CanPutItemToSlot(PlayerManager.LocalPlayerScript, itemSlot.ItemSlot, item, NetworkSide.Client)
                                ? successOverlayColor : failOverlayColor);
        }