Interface Adapter
Adapters determine how Flexalon measures other Unity components. See adapters documentation.
Syntax
public interface Adapter
Methods
Measure(FlexalonNode, Vector3, Vector3, Vector3)
Measure the size of this node.
Declaration
Bounds Measure(FlexalonNode node, Vector3 size, Vector3 min, Vector3 max)
Parameters
Type | Name | Description |
---|---|---|
FlexalonNode | node | The node to measure. |
UnityEngine.Vector3 | size | The size set by the Flexalon Object Component. The adapter should update any axis set to SizeType.Component. |
UnityEngine.Vector3 | min | The maximum size, determined by the MinSizeType. |
UnityEngine.Vector3 | max | The maximum size, determined by the MaxSizeType and the parent layout. |
Returns
Type | Description |
---|---|
UnityEngine.Bounds | The measured bounds to use in layout. |
TryGetRectSize(FlexalonNode, out Vector2)
Return what the rect transform size should be.
Declaration
bool TryGetRectSize(FlexalonNode node, out Vector2 rectSize)
Parameters
Type | Name | Description |
---|---|---|
FlexalonNode | node | The node to update. |
UnityEngine.Vector2 | rectSize | The desired rect size. |
Returns
Type | Description |
---|---|
bool | True if the rect size should be modified. |
TryGetScale(FlexalonNode, out Vector3)
Return what the gameObject's scale should be in local space.
Declaration
bool TryGetScale(FlexalonNode node, out Vector3 scale)
Parameters
Type | Name | Description |
---|---|---|
FlexalonNode | node | The node to update. |
UnityEngine.Vector3 | scale | The desired scale. |
Returns
Type | Description |
---|---|
bool | True if the scale should be modified. |