示例#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;
                    }
                }
            }
        }
    }