示例#1
0
 protected override void ExitSlot(UI_BaseSlot slot)
 {
     if (popUpinfo != null)
     {
         popUpinfo.Show(false);
     }
 }
示例#2
0
 protected override void ClickUp(UI_BaseSlot slot)
 {
     if (UI_DragIcon.dragFrom == -1)
     {
         return;
     }
 }
示例#3
0
        protected override void ClickSlot(UI_BaseSlot slot)
        {
            var index = displayIndexs[slots.IndexOf(slot as T)];

            if (index == -1)
            {
                return;
            }

            if (UI_DragIcon.dragFrom != -1)
            {
                inventory.SwitchPositions(UI_DragIcon.dragFrom, UI_DragIcon.dragTo);
                UI_DragIcon.dragFrom = -1;
                UI_DragIcon.dragTo   = -1;
                dragIcon.Show(false);
            }
            else
            {
                if (inventory.GetItem(index) == Item.Empty)
                {
                    return;
                }
                UI_DragIcon.dragFrom = displayIndexs[slots.IndexOf(slot as T)];
                dragIcon.SetItem(inventory.GetItem(index));
            }
        }
示例#4
0
        protected override void EnterSlot(UI_BaseSlot slot)
        {
            var index = displayIndexs[slots.IndexOf(slot as T)];

            if (index == -1)
            {
                return;
            }
            if (info != null)
            {
                if (inventory.GetItem(index) != Item.Empty)
                {
                    info.ShowDescription(inventory.GetItem(index));
                }
            }
            if (popUpinfo != null && inventory.GetItem(index) != Item.Empty)
            {
                if (popUpNextToSlot)
                {
                    popUpinfo.GetComponent <RectTransform>().SetPositionAndRotation(slot.GetComponent <RectTransform>().position + (Vector3)popUpOffest, Quaternion.identity);
                }
                var item = inventory.GetItem(index);
                popUpinfo.ShowDescription(item.name, item.GetDescription(), slot);
            }
            UI_DragIcon.dragTo = index;
        }
示例#5
0
 protected override void Drag(UI_BaseSlot slot)
 {
 }
示例#6
0
 protected int GetIndex(UI_BaseSlot slot)
 {
     return(slots.IndexOf(slot as T));
 }
示例#7
0
 protected abstract void Drag(UI_BaseSlot slot);
示例#8
0
 protected abstract void ClickUp(UI_BaseSlot slot);
示例#9
0
 protected abstract void EnterSlot(UI_BaseSlot slot);
示例#10
0
 protected abstract void ExitSlot(UI_BaseSlot slot);
示例#11
0
 internal void ShowDescription(string title, string desc, UI_BaseSlot slot)
 {
     Show(true);
     titel.text       = title;
     description.text = desc;
 }
示例#12
0
 protected override void ExitSlot(UI_BaseSlot slot)
 {
     popUpInfo.Show(false);
 }
示例#13
0
    protected override void EnterSlot(UI_BaseSlot slot)
    {
        var index = GetIndex(slot);

        popUpInfo.ShowDescription(shop.GetItemName(index), shop.GetItemDescription(index), slot);
    }
示例#14
0
 protected override void ClickUp(UI_BaseSlot slot)
 {
 }
示例#15
0
 protected override void ClickSlot(UI_BaseSlot slot)
 {
     selectItem = GetIndex(slot);
     info.ShowDescription(shop.GetItemName(selectItem), shop.GetItemDescription(selectItem));
 }