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

DestructibleGlobalMeshSpawner Class

Extends MonoBehaviour
The DestructibleGlobalMeshSpawner class manages the spawning and lifecycle of destructible global meshes within the MRUK framework.
It listens to room events and dynamically creates or removes destructible meshes as rooms are created or removed. For more details on room management, see MRUKRoom.

Fields

MRUK.RoomFilter CreateOnRoomLoaded[Get]
Event triggered when a destructible mesh is successfully created.
Function delegate that processes the segmentation result.
It can be used to modify the segmentation results before they are instantiated.

Properties

Gets or sets whether to keep some reserved un-destructible space (defined in meters).
Gets or sets the number of points per unit along the X-axis for the destructible mesh.
This setting affects the density and detail of the mesh, influencing both visual quality and performance.
Gets or serts the number of points per unit along the Y-axis for the destructible mesh.
This setting affects the density and detail of the mesh, influencing both visual quality and performance.
Gets or sets the maximum number of points that the destructible mesh can contain.
The higher number of points the higher the impact on performance
Gets or sets the material used for the mesh.
This material is applied to the mesh segments that are created during the segmentation process.
Gets or sets the reserved space at the top of the mesh.
This space is not included in the destructible area, allowing for controlled segmentation.
Gets or sets the reserved space at the bottom of the mesh.
TThis space is not included in the destructible area, allowing for controlled segmentation.

Member Functions

Adds a destructible global mesh to a specific room.
This method checks for existing meshes in the room and creates a new one if none exists. The destructible mesh is created using the specified parameters, including the material, points per unit, and maximum points count. A DestructibleMeshComponent is added to the destructible global mesh game object, and the segmentation process is started.
Parameters
room
The room to which the mesh will be added.
Returns
The destructible mesh created for the room.
Attempts to find a destructible mesh associated with a specific room.
If found, the method returns true and provides the mesh via an out parameter.
Parameters
room
The room for which to find the destructible mesh.
destructibleGlobalMesh
Out parameter that will hold the destructible mesh if found.
Returns
False if the mesh is not found (i.e., default value is returned), otherwise true.
Removes a destructible global mesh from the specified room.
If no room is specified, it defaults to the current room.
Parameters
room
The room from which the mesh will be removed. If null, the current room is used.
Did you find this page helpful?
Thumbs up icon
Thumbs down icon