Class FlexalonConstraint
The Flexalon Constraint component positions its gameObject relative to a target, which can be any other gameObject. The constrained object or the target can also have layout components, which provides a powerful way to combine layouts together.
Inheritance
Implements
Inherited Members
Syntax
[DisallowMultipleComponent]
[AddComponentMenu("Flexalon/Flexalon Constraint")]
[HelpURL("https://www.flexalon.com/docs/constraints")]
public class FlexalonConstraint : FlexalonComponent, Constraint
Properties
DepthAlign
Determines how the depth axis aligns to the target's box.
Declaration
public Align DepthAlign { get; set; }
Property Value
| Type | Description |
|---|---|
| Align |
DepthPivot
Determines how the depth axis aligns to this object's box.
Declaration
public Align DepthPivot { get; set; }
Property Value
| Type | Description |
|---|---|
| Align |
HorizontalAlign
Determines how the horizontal axis aligns to the target's box.
Declaration
public Align HorizontalAlign { get; set; }
Property Value
| Type | Description |
|---|---|
| Align |
HorizontalPivot
Determines how the horizontal axis aligns to this object's box.
Declaration
public Align HorizontalPivot { get; set; }
Property Value
| Type | Description |
|---|---|
| Align |
Target
Which gameObject to constrain to. The position depends on the Align and Pivot options (see below). The rotation is set to match the target's rotation. The available space is set to match the target's size. Set the width, height, and depth properties on the Flexalon Object Component to Parent to match the target's size.
Declaration
public GameObject Target { get; set; }
Property Value
| Type | Description |
|---|---|
| UnityEngine.GameObject |
VerticalAlign
Determines how the vertical axis aligns to the target's box.
Declaration
public Align VerticalAlign { get; set; }
Property Value
| Type | Description |
|---|---|
| Align |
VerticalPivot
Determines how the vertical axis aligns to this object's box.
Declaration
public Align VerticalPivot { get; set; }
Property Value
| Type | Description |
|---|---|
| Align |
Methods
Constrain(FlexalonNode)
Applies the constraint.
Declaration
public void Constrain(FlexalonNode node)
Parameters
| Type | Name | Description |
|---|---|---|
| FlexalonNode | node |
DoUpdate()
Called when the component is updated.
Declaration
public override void DoUpdate()
Overrides
ResetProperties()
Called when the component is destroyed to reset properties on the FlexalonNode.
Declaration
protected override void ResetProperties()
Overrides
UpdateProperties()
Called when the component is enabled to apply properties to the FlexalonNode.
Declaration
protected override void UpdateProperties()