Class ToolTipUtility
Static class providing useful functions for finding ToolTip Attach point information.
Inherited Members
Namespace: Microsoft.MixedReality.Toolkit.UI
Assembly: cs.temp.dll.dll
Syntax
public static class ToolTipUtility
Methods
FindClosestAttachPointToAnchor(Transform, Transform, Vector3[], ToolTipAttachPoint)
Avoid running this query in Update function because calculating Vector3.Distance requires sqr root calculation (expensive) Instead, find strategic moments to update nearest pivot (i.e. only once when ToolTip becomes active)
Declaration
public static Vector3 FindClosestAttachPointToAnchor(Transform anchor, Transform contentParent, Vector3[] localPivotPositions, ToolTipAttachPoint pivotType)
Parameters
Type | Name | Description |
---|---|---|
Transform | anchor | Transform of object serving as anchor for tooltip |
Transform | contentParent | Transform for the tooltip content |
Vector3[] | localPivotPositions | list of positions to find the closest |
ToolTipAttachPoint | pivotType | pivot type needed for calculation of closest |
Returns
Type | Description |
---|---|
Vector3 | Vector3 the point in localPivotPositions which is closest to the anchor position |
GetAttachPointPositions(ref Vector3[], Vector2)
gets an array of pivot positions
Declaration
public static void GetAttachPointPositions(ref Vector3[] pivotPositions, Vector2 localContentSize)
Parameters
Type | Name | Description |
---|---|---|
Vector3[] | pivotPositions | ref array that gets filled with positions |
Vector2 | localContentSize | the xy scale of the tooltip |