protected override void ExitSlot(UI_BaseSlot slot) { if (popUpinfo != null) { popUpinfo.Show(false); } }
protected override void ClickUp(UI_BaseSlot slot) { if (UI_DragIcon.dragFrom == -1) { return; } }
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)); } }
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; }
protected override void Drag(UI_BaseSlot slot) { }
protected int GetIndex(UI_BaseSlot slot) { return(slots.IndexOf(slot as T)); }
protected abstract void Drag(UI_BaseSlot slot);
protected abstract void ClickUp(UI_BaseSlot slot);
protected abstract void EnterSlot(UI_BaseSlot slot);
protected abstract void ExitSlot(UI_BaseSlot slot);
internal void ShowDescription(string title, string desc, UI_BaseSlot slot) { Show(true); titel.text = title; description.text = desc; }
protected override void ExitSlot(UI_BaseSlot slot) { popUpInfo.Show(false); }
protected override void EnterSlot(UI_BaseSlot slot) { var index = GetIndex(slot); popUpInfo.ShowDescription(shop.GetItemName(index), shop.GetItemDescription(index), slot); }
protected override void ClickUp(UI_BaseSlot slot) { }
protected override void ClickSlot(UI_BaseSlot slot) { selectItem = GetIndex(slot); info.ShowDescription(shop.GetItemName(selectItem), shop.GetItemDescription(selectItem)); }