API reference
API reference
Select your platform
No SDKs available
No versions available

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.

Member Functions

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.
Parameters
anchor
The anchor info to use.
prefabs
The list of prefabs to select from. Can be null.
Returns
The selected prefab.
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.
Parameters
localScale
The local scale of the prefab.
Returns
The scaled local scale of the prefab.
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.
Parameters
localScale
The local scale of the prefab.
Returns
The scaled local scale of the prefab.
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.
Parameters
anchorVolumeBounds
The volume bounds of the anchor.
prefabBounds
The bounds of the prefab.
Returns
The local position of the prefab defined as the difference between the anchor's pivot and the prefab's pivot.
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.
Parameters
anchorPlaneRect
The volume bounds of the anchor.
prefabBounds
The bounds of the prefab.
Returns
The local position of the prefab defined as the difference between the anchor's pivot and the prefab's pivot.
Did you find this page helpful?
Thumbs up icon
Thumbs down icon