Skip to content

LineRouter

Source: Assets/UpscaleSDK/Core/UI/Runtime/DeviceLayout/LineRouter.cs

struct LineContext

Everything a router needs to draw one connector: the target anchor, which side of the device the row sits on, the row's attach point (RowX/RowY is the row's inner-edge midpoint), the row's dimensions, and the device bounds plus safety padding around the anchor.

Fields

public readonly Vector2 AnchorLocal

public readonly LayoutSide Side

public readonly float RowX

public readonly float RowY

public readonly float RowWidth

public readonly float RowHeight

public readonly Vector2 DeviceMin

public readonly Vector2 DeviceMax

public readonly float AnchorRadius

public readonly float AnchorPadding

Properties

public bool IsLeft

public bool IsRight

public bool IsTop

public bool IsBottom

public bool IsHorizontal

public bool IsVertical

class LineRouter

Turns a placed row plus its target anchor into the polyline that visually connects them. Attach one concrete LineRouter beside a device layout view; the view delegates all line routing to it, so adding a new visual style is a new component — no changes to the view.

Methods

protected virtual void OnValidate()

public abstract Vector2[] BuildLinePoints(in LineContext ctx)

protected static Vector2 ComputeSafeAnchorPoint(Vector2 anchorCenter, Vector2 fromPoint, float radius, float padding)