_random
: Random |
Signature
Random _random |
onPrefabSpawned
: UnityEvent |
Signature
UnityEvent onPrefabSpawned |
PrefabsToSpawn
: List< AnchorPrefabGroup > |
The list of AnchorPrefabGroup configurations that determine how prefabs are spawned based on anchor data.
Signature
List<AnchorPrefabGroup> PrefabsToSpawn |
SeedValue
: int |
Signature
int SeedValue |
SpawnOnStart
: MRUK.RoomFilter |
Signature
MRUK.RoomFilter SpawnOnStart |
AnchorPrefabSpawnerObjects
: Dictionary< MRUKAnchor, GameObject >
[Get] |
Signature
Dictionary<MRUKAnchor, GameObject> AnchorPrefabSpawnerObjects |
SpawnedPrefabs
: List< GameObject >
[Get] |
Signature
List<GameObject> SpawnedPrefabs |
ClearPrefab
(
go
)
|
Destroys the specified GameObject, effectively removing the prefab from the scene.
Signature
virtual void ClearPrefab(GameObject go) Parameters go: GameObject
The GameObject to be destroyed.
Returns void |
ClearPrefab
(
anchorInfo
)
|
Clears the gameobject associated with the anchor.
Useful when receiving an event that a specific anchor has been removed
Signature
virtual void ClearPrefab(MRUKAnchor anchorInfo) Parameters Returns void |
ClearPrefabs
(
room
)
|
Clears all the spawned gameobjects from this AnchorPrefabSpawner in the given room.
Signature
virtual void ClearPrefabs(MRUKRoom room) Parameters Returns void |
ClearPrefabs
()
|
Clears all the gameobjects created with the PrefabSpawner.
Signature
virtual void ClearPrefabs() Returns void |
ReceiveAnchorCreatedEvent
(
anchorInfo
)
|
Responds to the event of a new anchor being created within the scene.
This method triggers the spawning of prefabs if the anchor's room is being tracked and updates are enabled.
Signature
virtual void ReceiveAnchorCreatedEvent(MRUKAnchor anchorInfo) Parameters Returns void |
ReceiveAnchorRemovedCallback
(
anchorInfo
)
|
Responds to the event of an anchor being removed from the scene.
This method clears all prefabs spawned by this spawner.
Signature
virtual void ReceiveAnchorRemovedCallback(MRUKAnchor anchorInfo) Parameters Returns void |
ReceiveAnchorUpdatedCallback
(
anchorInfo
)
|
Responds to the event of an anchor being updated within the scene.
This method clears existing prefabs and triggers the spawning of new prefabs based on the updated anchor information, provided that updates are being tracked and the anchor or its parent room is not marked as untracked.
Signature
virtual void ReceiveAnchorUpdatedCallback(MRUKAnchor anchorInfo) Parameters Returns void |
ReceiveCreatedRoom
(
room
)
|
Responds to the event of a new room being created within the scene.
This method triggers the spawning of prefabs and registers for anchor updates within the room, provided that room updates are being tracked and the configuration is set to handle all rooms.
Signature
virtual void ReceiveCreatedRoom(MRUKRoom room) Parameters Returns void |
ReceiveRemovedRoom
(
room
)
|
Handles the event when a room is removed from the scene.
This method clears all prefabs associated with the room and unregisters updates for anchors within the room.
Signature
virtual void ReceiveRemovedRoom(MRUKRoom room) Parameters Returns void |
RegisterAnchorUpdates
(
room
)
|
Registers the anchor update events for a specific room.
This method starts listening for anchor creation, removal, and update events within the specified room.
Signature
virtual void RegisterAnchorUpdates(MRUKRoom room) Parameters Returns void |
SpawnPrefab
(
anchorInfo
)
|
Spawns a prefab based on the provided anchor information.
This method determines the appropriate prefab to spawn based on the anchor's label, checks for existing instances, and configures the spawned prefab's position, scale, and orientation according to the anchor's properties and predefined settings.
Signature
virtual void SpawnPrefab(MRUKAnchor anchorInfo) Parameters Returns void |
SpawnPrefabs
(
clearPrefabs
)
|
Spawns prefabs according to the settings.
Signature
virtual void SpawnPrefabs(bool clearPrefabs=true) Parameters clearPrefabs: bool
Clear already existing prefabs before.
Returns void |
SpawnPrefabs
(
room
, clearPrefabs
)
|
Creates gameobjects for the given room.
Signature
virtual void SpawnPrefabs(MRUKRoom room, bool clearPrefabs=true) Parameters clearPrefabs: bool
clear all before adding them again
Returns void |
UnRegisterAnchorUpdates
(
room
)
|
Unregisters the anchor update events for a specific room.
This method stops listening for anchor creation, removal, and update events within the specified room.
Signature
virtual void UnRegisterAnchorUpdates(MRUKRoom room) Parameters Returns void |
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
virtual Vector3 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
virtual Vector3 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
virtual Vector3 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
virtual Vector2 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
virtual GameObject CustomPrefabSelection(MRUKAnchor anchor, List< GameObject > prefabs) Parameters prefabs: List< GameObject >
The list of prefabs to select from. Can be null.
Returns GameObject
The selected prefab.
|
InitializeRandom
(
seed
)
|
Initializes a new instance of the Random class using the specified seed.
Signature
void InitializeRandom(ref int seed) Parameters seed: ref int
The seed value to initialize the random number generator. If zero, the seed will be set to the current system tick count.
Returns void |
Alignment
: AlignMode |
Signature
AlignMode Alignment |
CalculateFacingDirection
: bool |
Signature
bool CalculateFacingDirection |
IgnorePrefabSize
: bool |
Signature
bool IgnorePrefabSize |
Labels
: MRUKAnchor.SceneLabels |
Signature
MRUKAnchor.SceneLabels Labels |
MatchAspectRatio
: bool |
Signature
bool MatchAspectRatio |
Prefabs
: List< GameObject > |
Signature
List<GameObject> Prefabs |
PrefabSelection
: SelectionMode |
Signature
SelectionMode PrefabSelection |
Scaling
: ScalingMode |
Signature
ScalingMode Scaling |
| Member | Description |
|---|---|
Stretch |
Stretch each axis to exactly match the size of the Plane/Volume.
|
UniformScaling |
Scale each axis by the same amount to maintain the correct aspect ratio.
|
UniformXZScale |
Scale the X and Z axes uniformly but the Y scale can be different.
|
NoScaling |
Don't perform any scaling.
|
Custom |
Custom logic, extend this class and override CustomPrefabScaling with your own implementation.
|
| Member | Description |
|---|---|
Automatic |
For volumes align to the base, for planes align to the center.
|
Bottom |
Align the bottom of the prefab with the bottom of the volume or plane.
|
Center |
Align the center of the prefab with the center of the volume or plane.
|
NoAlignment |
Don't add any local offset to the prefab.
|
Custom |
Custom logic, extend this class and override CustomPrefabAlignment with your own implementation.
|
| Member | Description |
|---|---|
Random | |
ClosestSize | |
Custom |
Custom logic, extend this class and override CustomPrefabSelection with your own implementation.
|