The position type for VisionOSWindowPosition. This API mimics the native SwiftUI WindowPlacement.Position structure with which it is implemented.
Window position relative to the top edge of another window or scene, specified via the VisionOSWindowPosition constructor's relativeWindowID parameter.
#if UNITY_VISIONOS && !UNITY_EDITOR
var webView = await VisionOSWebView.CreateInWindow(
new VisionOSWindowOptions {
Size = new Vector2Int(1000, 1000),
Position = new VisionOSWindowPosition(
VisionOSWindowPositionType.Above,
VisionOSWindowPosition.UnityBoundedSceneID
)
}
);
#endifWindow position relative to the bottom edge of another window or scene, specified via the VisionOSWindowPosition constructor's relativeWindowID parameter.
#if UNITY_VISIONOS && !UNITY_EDITOR
var webView = await VisionOSWebView.CreateInWindow(
new VisionOSWindowOptions {
Size = new Vector2Int(1000, 1000),
Position = new VisionOSWindowPosition(
VisionOSWindowPositionType.Below,
VisionOSWindowPosition.UnityBoundedSceneID
)
}
);
#endifWindow position relative to the leading (left) edge of another window or scene, specified via the VisionOSWindowPosition constructor's relativeWindowID parameter.
#if UNITY_VISIONOS && !UNITY_EDITOR
var webView = await VisionOSWebView.CreateInWindow(
new VisionOSWindowOptions {
Size = new Vector2Int(1000, 1000),
Position = new VisionOSWindowPosition(
VisionOSWindowPositionType.Leading,
VisionOSWindowPosition.UnityBoundedSceneID
)
}
);
#endifWindow position relative to the trailing (right) edge of another window or scene, specified via the VisionOSWindowPosition constructor's relativeWindowID parameter.
#if UNITY_VISIONOS && !UNITY_EDITOR
var webView = await VisionOSWebView.CreateInWindow(
new VisionOSWindowOptions {
Size = new Vector2Int(1000, 1000),
Position = new VisionOSWindowPosition(
VisionOSWindowPositionType.Trailing,
VisionOSWindowPosition.UnityBoundedSceneID
)
}
);
#endifUtility panel window position. Utility panel window placement brings the window close, generally within direct touch range. This is the only VisionOSWindowPositionType for which a RelativeWindowID value is not required.
#if UNITY_VISIONOS && !UNITY_EDITOR
var webView = await VisionOSWebView.CreateInWindow(
new VisionOSWindowOptions {
Size = new Vector2Int(600, 400),
Position = new VisionOSWindowPosition(
VisionOSWindowPositionType.UtilityPanel
)
}
);
#endif