Interface IFlexalonSlottedLayout
- Namespace
- Flexalon
- Assembly
- Flexalon.dll
A layout that supports querying and placing objects at discrete locations.
public interface IFlexalonSlottedLayout
Methods
GetSlot(GameObject)
Captures the object's current resolved slot, or null if it has no placement in this layout.
FlexalonSlot? GetSlot(GameObject gameObject)
Parameters
gameObjectGameObject
Returns
PlaceInOrder(GameObject, int)
Parents the object to this layout at the supplied sibling index and configures it for placement in hierarchy order. Cell layouts clear explicit placement while preserving the cell component's enabled state, span, and overlap settings.
void PlaceInOrder(GameObject gameObject, int siblingIndex)
Parameters
gameObjectGameObjectsiblingIndexint
PlaceInSlot(GameObject, in FlexalonSlot)
Parents the object to this layout and applies a slot belonging to it without searching or checking occupancy. Implementations establish the sibling order required for slot placement. Cell layouts enable explicit placement, preserve span and overlap settings, and use sibling index zero to give the object placement priority.
void PlaceInSlot(GameObject gameObject, in FlexalonSlot slot)
Parameters
gameObjectGameObjectslotFlexalonSlot
PreparePlaceholder(GameObject, GameObject)
Copies the dragged object's layout-specific options to a placeholder without changing the source. May be called again when the selected placement changes.
void PreparePlaceholder(GameObject gameObject, GameObject placeholder)
Parameters
gameObjectGameObjectplaceholderGameObject
TryGetFirstOpenSlot(in FlexalonSlotQuery, out FlexalonSlot)
Finds the first fitting open span in layout order. Does not require overlap with the item bounds.
bool TryGetFirstOpenSlot(in FlexalonSlotQuery query, out FlexalonSlot slot)
Parameters
queryFlexalonSlotQueryThe item, intended bounds center, and optional candidate filter.
slotFlexalonSlotThe selected slot, or default if no candidate is accepted.
Returns
- bool
TryGetNearestOpenSlot(in FlexalonSlotQuery, SwapMode, in FlexalonSlot?, out FlexalonSlot, out FlexalonSlot)
Finds the nearest fitting open slot near the item center. Cell layouts also check immediate neighboring placements for multi-cell items.
bool TryGetNearestOpenSlot(in FlexalonSlotQuery query, SwapMode swapMode, in FlexalonSlot? swapSlot, out FlexalonSlot slot, out FlexalonSlot swapDestination)
Parameters
queryFlexalonSlotQueryThe item, intended bounds center, and optional candidate filter.
swapModeSwapModeNoSwap requires an open candidate. AllowSwap also accepts a candidate with one eligible occupant, reported in the slot's SwapNode. RequireSwap only accepts candidates with an occupant. The query does not move or exchange objects.
swapSlotFlexalonSlot?Optional slot the occupant would move to, such as the dragged item's starting slot. When set, candidates are rejected unless TryGetSwapSlot finds a placement for the occupant there that does not overlap the candidate.
slotFlexalonSlotThe selected slot, or default if no candidate is accepted.
swapDestinationFlexalonSlotWhere the selected slot's occupant would move, or default if the slot has no occupant or no swapSlot was given.
Returns
- bool
TryGetNearestSlot(in FlexalonSlotQuery, out FlexalonSlot)
Finds a fitting slot near the item center, using the layout's candidate and occupancy rules.
bool TryGetNearestSlot(in FlexalonSlotQuery query, out FlexalonSlot slot)
Parameters
queryFlexalonSlotQueryslotFlexalonSlot
Returns
- bool
TryGetSwapSlot(GameObject, in FlexalonSlot, out FlexalonSlot)
Finds a placement for the item that covers this slot, preferring the slot itself and otherwise the fitting placement nearest to it, so an item larger than the slot can shift to fit. Does not move the item. Cell layouts require containment within the solved layout and delegated row, ignore the item's existing placement and nonblocking overlaps, and check only top-level blockers when placing a whole row. Returns false for a slot owned by another layout or unavailable layout geometry.
bool TryGetSwapSlot(GameObject gameObject, in FlexalonSlot slot, out FlexalonSlot result)
Parameters
gameObjectGameObjectslotFlexalonSlotresultFlexalonSlot
Returns
- bool