예제 #1
0
    public override void OnBeginDrag(PointerEventData data)
    {
        base.OnBeginDrag(data);

        if (data.button == PointerEventData.InputButton.Left)
        {
            if (_slot != null)
            {
                if (_slot.GetType() == typeof(EquipmentSlot))
                {
                    EquipmentSlot es = (EquipmentSlot)_slot;
                    es.DeSlot(this);
                    _slot = null;
                }
                else if (_slot.GetType() == typeof(StorageSlot))
                {
                    StorageSlot   ss = (StorageSlot)_slot;
                    StorageWindow sw = ss.StorageWindow;
                    if (sw != null)
                    {
                        sw.DeSlot(ss, this);
                        _storageWindow = null;
                        _slot          = null;
                    }
                }
            }
        }
    }
예제 #2
0
    private void CheckMagazineStorage(Magazine m)
    {
        UIItem        uIItem = m.UIItem;
        StorageWindow sw     = m.UIItem.StorageWindow;
        StorageSlot   ss     = (StorageSlot)m.UIItem.Slot;

        if (sw && ss && uIItem)
        {
            sw.DeSlot(ss, uIItem);
        }
    }
예제 #3
0
    public virtual void Drop(object[] o)
    {
        Vector3 pos = Vector3.zero;

        if (o == null)
        {
            pos = gameManager.Actor.transform.position;
        }
        else if (o[0] != null)
        {
            pos = (Vector3)o[0];
        }

        EnablePhysics(true);
        uIItemManager.DeFocusOnUIItem(_UIItem);
        SetRenderes(true);
        _transform.parent   = GameManager.Instance.ItemManager.GroundTransform;
        _transform.position = pos;
        if (_UIItem.HotKey != -1)
        {
            hotKeys.RemoveHotKey(_UIItem.HotKey);
        }

        if (o != null && o[1] != null)
        {
            UIItem        uIItem        = (UIItem)o[1];
            ItemSlot      slot          = uIItem.Slot;
            StorageWindow storageWindow = uIItem.StorageWindow;

            if (storageWindow && slot)
            {
                storageWindow.DeSlot((StorageSlot)slot, uIItem);
                return;
            }
            if (slot)
            {
                slot.DeSlot(uIItem);
            }
        }
    }