示例#1
0
        internal void EndDragOutfit(OutfitItem outfitItem, PointerEventData data)
        {
            var raycastObj = data.pointerCurrentRaycast.gameObject;

            if (raycastObj != null && raycastObj.GetComponent <OutfitSlotItem>() != null)
            {
                //Update player inventory + update player vehicle weapons

                var slot = raycastObj.GetComponent <OutfitSlotItem>();

                //outfitItem.SetSlot(slot);

                //Get outfit from Game.Player.Inventory.Outfit
                Game.Player.ChangeOutfitSlot(outfitItem.Outfit, slot.Placement, slot.PositionIdx);

                //Get type of slot

                //Set placement and inventory pos

                //Update UI
                outfitItem.Slot = slot;
                SetOutfitParent(outfitItem, slot.transform);
            }
            else
            {
                SetOutfitParent(outfitItem, outfitItem.Slot.transform);
            }

            outfitItem.GetComponent <CanvasGroup>().blocksRaycasts = true;
            _isDragging = false;
        }
示例#2
0
        internal void DragOutfit(OutfitItem outfitItem, PointerEventData data)
        {
            //data.position
            outfitItem.GetComponent <CanvasGroup>().blocksRaycasts = false;

            _isDragging = true;
            StartCoroutine(_DoDragOutfit(outfitItem));
        }