public void OnDrop(PointerEventData eventData) { if (eventData.pointerDrag == null) { return; } CrewUIIcon crewIcon = eventData.pointerDrag.GetComponent <CrewUIIcon>(); if (crewIcon == null) { return; } CrewUISlot cur_slot = slot; bool cur_slot_vanish = cur_slot.vanish_empty; cur_slot.vanish_empty = false; CrewUISlot next_slot = crewIcon.slot; bool next_slot_vanish = next_slot.vanish_empty; next_slot.vanish_empty = false; LeaveSlot(); crewIcon.InsertInto(cur_slot); InsertInto(next_slot); Snap(); cur_slot.vanish_empty = cur_slot_vanish; next_slot.vanish_empty = next_slot_vanish; }
public void InsertNew(CrewUIIcon crewIcon) { GameObject crewSlotObj = Instantiate(Game.inst.crewSlotUI_prefab, gameObject.transform); CrewUISlot crewSlot = crewSlotObj.GetComponent <CrewUISlot>(); if (slotsVanish) { crewSlot.vanish_empty = slotsVanish; } crewIcon.InsertInto(crewSlot); crewIcon.Snap(); }
public void OnDrop(PointerEventData eventData) { if (eventData.pointerDrag == null) { return; } CrewUIIcon crewIcon = eventData.pointerDrag.GetComponent <CrewUIIcon>(); if (crewIcon == null) { return; } crewIcon.InsertInto(this); }