/// <summary> /// Called when the user starts dragging an item from a slot /// </summary> /// <param name="fromSlot">The slot the user dragged from.</param> public void StartDrag(DragableSlot fromSlot) { //Only react to the drag if there's actually an item in the slot. if (fromSlot.Content != null) { DraggingItem = true; //Store previous content in a local variable draggedItem = fromSlot.Content; fromSlot.RemoveContent (); //And store the slot the user dragged from, in order to place items when ending the drag draggedFrom = fromSlot; } }
/// <summary> /// Called when the user starts dragging an item from a slot /// </summary> /// <param name="fromSlot">The slot the user dragged from.</param> public void StartDrag(DragableSlot fromSlot) { //Only react to the drag if there's actually an item in the slot. if (fromSlot.Content != null) { DraggingItem = true; //Store previous content in a local variable draggedItem = fromSlot.Content; fromSlot.RemoveContent(); //And store the slot the user dragged from, in order to place items when ending the drag draggedFrom = fromSlot; } }