API reference

ICustomAnchorPrefabSpawner Interface

Defines methods for custom selection, scaling, and alignment of prefabs.
Extend the AnchorPrefabSpawner class and override the methods offered by this interface implementing any custom logic.

Methods

CustomPrefabAlignment ( anchorVolumeBounds , prefabBounds )
Aligns a prefab to an anchor's volume, based on custom logic.
This method is intended to be overridden a class that extends AnchorPrefabSpawner with custom logic for aligning a prefab. If not overridden, it throws a NotImplementedException.
Signature
Vector3 Meta.XR.MRUtilityKit.ICustomAnchorPrefabSpawner.CustomPrefabAlignment(Bounds anchorVolumeBounds, Bounds? prefabBounds)
Parameters
anchorVolumeBounds: Bounds  The volume bounds of the anchor.
prefabBounds: Bounds?  The bounds of the prefab.
Returns
Vector3  The local position of the prefab defined as the difference between the anchor's pivot and the prefab's pivot.
CustomPrefabAlignment ( anchorPlaneRect , prefabBounds )
Aligns a prefab to an anchor's plane rect, based on custom logic.
This method is intended to be overridden a class that extends AnchorPrefabSpawner with custom logic for aligning a prefab. If not overridden, it throws a NotImplementedException.
Signature
Vector3 Meta.XR.MRUtilityKit.ICustomAnchorPrefabSpawner.CustomPrefabAlignment(Rect anchorPlaneRect, Bounds? prefabBounds)
Parameters
anchorPlaneRect: Rect  The volume bounds of the anchor.
prefabBounds: Bounds?  The bounds of the prefab.
Returns
Vector3  The local position of the prefab defined as the difference between the anchor's pivot and the prefab's pivot.
CustomPrefabScaling ( localScale )
Scales a prefab based on custom logic.
This method is intended to be overridden in a class that extends AnchorPrefabSpawner with custom logic for scaling a prefab. If not overridden, it throws a NotImplementedException.
Signature
Vector3 Meta.XR.MRUtilityKit.ICustomAnchorPrefabSpawner.CustomPrefabScaling(Vector3 localScale)
Parameters
localScale: Vector3  The local scale of the prefab.
Returns
Vector3  The scaled local scale of the prefab.
CustomPrefabScaling ( localScale )
Scales a prefab based on custom logic.
This method is intended to be overridden a class that extends AnchorPrefabSpawner with custom logic for scaling a prefab. If not overridden, it throws a NotImplementedException.
Signature
Vector2 Meta.XR.MRUtilityKit.ICustomAnchorPrefabSpawner.CustomPrefabScaling(Vector2 localScale)
Parameters
localScale: Vector2  The local scale of the prefab.
Returns
Vector2  The scaled local scale of the prefab.
CustomPrefabSelection ( anchor , prefabs )
Selects a prefab based on custom logic.
This method is intended to be overridden in a class that extends AnchorPrefabSpawner with custom logic for selecting a prefab. It will be called whenever the PrefabSelection of an AnchorPrefabGroup is set to Custom.
Signature
GameObject Meta.XR.MRUtilityKit.ICustomAnchorPrefabSpawner.CustomPrefabSelection(MRUKAnchor anchor, List< GameObject > prefabs)
Parameters
anchor: MRUKAnchor  The anchor info to use.
prefabs: List< GameObject >  The list of prefabs to select from. Can be null.
Returns
GameObject  The selected prefab.