Class FlexalonLayoutBase
- Namespace
- Flexalon
- Assembly
- Flexalon.dll
Base class for all layout componets. See custom layout for details on how to extend this class. Assigns the Layout method to IFlexalonNode and keeps the node's children up to date.
[DisallowMultipleComponent]
[RequireComponent(typeof(FlexalonObject))]
public abstract class FlexalonLayoutBase : FlexalonComponent, IFlexalonLayout
- Inheritance
-
objectObjectComponentBehaviourMonoBehaviourFlexalonLayoutBase
- Implements
- Derived
- Inherited Members
Methods
Arrange(IFlexalonNode, Vector3)
Position the children of node within the available bounds.
public virtual void Arrange(IFlexalonNode node, Vector3 layoutSize)
Parameters
nodeIFlexalonNodelayoutSizeVector3
FastSwapChild(IFlexalonNode, IFlexalonNode)
Updates cached child references after a trusted swap. Both nodes already occupy their new slots. A same-parent exchange invokes this notification once; other swaps invoke each affected layout. The previous child is detached when the replacement was detached. Override when retaining child references between layout passes. This notification does not validate compatibility or request a new layout pass.
public virtual void FastSwapChild(IFlexalonNode previous, IFlexalonNode replacement)
Parameters
previousIFlexalonNodereplacementIFlexalonNode
Initialize()
Called when the component is first created.
protected override void Initialize()
Measure(IFlexalonNode, Vector3, Vector3, Vector3)
Perform minimal work to determine what the size of node and available size for node's children.
public virtual Bounds Measure(IFlexalonNode node, Vector3 size, Vector3 min, Vector3 max)
Parameters
nodeIFlexalonNodesizeVector3minVector3maxVector3
Returns
- Bounds
ResetProperties()
Removes this component's properties from the IFlexalonNode, undoing UpdateProperties. Called when the component is disabled or destroyed. It can run more than once in a row, so it must be idempotent.
protected override void ResetProperties()
ResolveChildAlign(IFlexalonNode, int, Align)
Resolves a child's alignment override, or returns the layout's fallback alignment.
protected static Align ResolveChildAlign(IFlexalonNode child, int axis, Align fallback)
Parameters
childIFlexalonNodeaxisintfallbackAlign
Returns
SetChildrenFillShrinkSize(IFlexalonNode, Vector3, Vector3)
Helper to assign the fill and shrink size for all children.
protected void SetChildrenFillShrinkSize(IFlexalonNode node, Vector3 childSize, Vector3 layoutSize)
Parameters
nodeIFlexalonNodechildSizeVector3layoutSizeVector3
UpdateProperties()
Applies this component's properties to the IFlexalonNode, such as registering the component as the node's layout, adapter, or modifier. Called when the component is enabled, and from MarkDirty while it's active, so it can run many times in a row. It must be idempotent and cheap.
protected override void UpdateProperties()