コード例 #1
0
ファイル: HotbarInvHandler.cs プロジェクト: Theerapon/GDSG
    private void Drop(BaseItemSlot tranferItemSlot)
    {
        if (dragItemSlot == null)
        {
            return;
        }

        if (tranferItemSlot.CanReceiveItem(dragItemSlot.ITEM) && dragItemSlot.CanReceiveItem(tranferItemSlot.ITEM))
        {
            SwapItems(tranferItemSlot);
        }
    }
コード例 #2
0
    private void Drop(int index, BaseItemSlot dropItemSlot)
    {
        if (_draggedItemSlot == null)
        {
            return;
        }

        if (dropItemSlot.CanAddStack(_draggedItemSlot.Item) || (dropItemSlot.CanReceiveItem(_draggedItemSlot.Item) && _draggedItemSlot.CanReceiveItem(dropItemSlot.Item)))
        {
            InvokeServerRpc(ChangeItemSlots, _draggedItemSlotIndex, _draggedItemSlot.GetType().ToString(), index, dropItemSlot.GetType().ToString());
        }
    }
コード例 #3
0
ファイル: Character.cs プロジェクト: ransomink/EventSystem
    private void Drop(BaseItemSlot dropItemSlot)
    {
        if (dragItemSlot == null)
        {
            return;
        }

        if (dropItemSlot.CanAddStack(dragItemSlot.Item))
        {
            AddStacks(dropItemSlot);
        }
        else if (dropItemSlot.CanReceiveItem(dragItemSlot.Item) && dragItemSlot.CanReceiveItem(dropItemSlot.Item))
        {
            SwapItems(dropItemSlot);
        }
    }
コード例 #4
0
 void Drop(BaseItemSlot _itemSlot)
 {
     if (dragItemSlot == null)
     {
         return;                       //만약 drop한 슬롯에 아무도 없으면 반환, drag한 건 전부다 되돌려진다
     }
     if (_itemSlot.CanAddStack(dragItemSlot.Item))
     {
         AddStacks(_itemSlot);
     }
     else if (_itemSlot.CanReceiveItem(dragItemSlot.Item) && dragItemSlot.CanReceiveItem(_itemSlot.Item)) // 처음 dragSlot과 dropSlot 둘다 아이템이 들어갈 수 있다면
     {
         SwapItem(_itemSlot);
     }
     // 마지막으로 drag한 아이템슬롯 = _itemSlot, 처음 drag를 시작 아이템슬록 = dragItemSlot
 }
コード例 #5
0
    // chedk this out down > probably not relevant now
    private void Drop(BaseItemSlot dropItemSlot)
    {
        if (dragItemSlot == null)
        {
            return;
        }

        if (dropItemSlot.CanAddStack(dragItemSlot.Item))
        {
            AddStacks(dropItemSlot);
            SoundManager.Instance.PlaySFX(buttonClickSFX, 1);
        }

        else if (dropItemSlot.CanReceiveItem(dragItemSlot.Item) && dragItemSlot.CanReceiveItem(dropItemSlot.Item))
        {
            SwapItems(dropItemSlot);
            SoundManager.Instance.PlaySFX(buttonClickSFX, 1);
        }
    }
コード例 #6
0
    private void Drop(UISlot dropUISlot)
    {
        if (dropUISlot is BaseItemSlot)
        {
            BaseItemSlot dropItemSlot = dropUISlot as BaseItemSlot;
            if (dragItemSlot == null)
            {
                return;
            }

            if (dropItemSlot.CanAddStack(dragItemSlot.Item))
            {
                AddStacks(dropItemSlot);
            }
            else if (dropItemSlot.CanReceiveItem(dragItemSlot.Item) && dragItemSlot.CanReceiveItem(dropItemSlot.Item))
            {
                SwapItems(dropItemSlot);
            }
        }
        else if (dropUISlot is BaseSkillSlot)
        {
            BaseSkillSlot dropSkillSlot = dropUISlot as BaseSkillSlot;
            if (dragSkillSlot == null)
            {
                return;
            }

            if (dropSkillSlot is UsableSkillSlot)
            {
                ActiveSkill holdSkill = dragSkillSlot.Skill as ActiveSkill;
                if (dragSkillSlot is UsableSkillSlot)
                {
                    SkillWindow.RemoveSkill(holdSkill);
                    if (dropSkillSlot.Skill)
                    {
                        SkillWindow.EquipSkill(dropSkillSlot.Skill as ActiveSkill, 0, dragSkillSlot as UsableSkillSlot);
                    }
                }
                SkillWindow.EquipSkill(holdSkill, 0, dropUISlot as UsableSkillSlot);
            }
        }
    }