Give Page Feedback | API

Chunk Destroyers - Simple Chunk Destroyer

The Simple Chunk Destroyer is a very rudimentary implementation of a Chunk Destroyer. It will only search one level deep from the root Asset Chunk in order to find game objects to destroy, therefore if you have deeper hierarchies, it can be a good idea to create a Custom Chunk Destroyer instead of using this one.

It will destroy all child game objects of the root Asset Chunk and then finally the root Asset Chunk itself. It destroys a specific number of game objects per frame, and then either yields for a frame or for a fixed set of time.

Creating A Simple Chunk Destroyer Component

You can add this component by selecting a game object and then selecting from the Top Menu Bar:

Component -> Deep Space Labs -> -> SAM -> Chunk Destroyers -> Simple Chunk Destroyer

Adding A Simple Chunk Destroyer Component From The Top Menu Bar GIF

or by selecting a game object and using the Add Component menu via its inspector:

Component -> Deep Space Labs -> -> SAM -> Chunk Destroyers -> Simple Chunk Destroyer

Adding A Simple Chunk Destroyer Component From Add Component Menu GIF

Max Objects To Destroy In A Single Frame

The Destroyer will never destroy more than this number of game objects in a single frame. If there aren't that many game objects left in the Chunk's hierarchy, it won't reach this number, however in all other cases it will.

Min Destroy Key

An Extra Data Key that can be used to access an override value for 'Max Objects To Destroy In A Single Frame'. The key is used for each LOD Group that the Destroyer will destroy chunks for, which can be useful for configuring different settings for different types of assets.

Count Grandchildren

If enabled, the grandchildren (children of children of each root Asset Chunk) will be counted towards the 'Target Objects To Destroy In A Single Frame'.

In some situations, this may result in more consistent destruction calls per frame, especially if the number of grandchild that exist on each child of the root asset chunk varies a lot.

Note that when this setting is enabled, though the grandchildren are considered in the count, they are not manually destroyed, but instead destroyed as a result of the manual destruction of their direct parent (which will be a child of each root asset chunk). As such, it is possible for more total game objects to be destroyed than 'Target Objects To Destroy In A Single Frame'.

Yield Time

The time in seconds to yield after destroying the max objects to destroy in a single frame. If you set this to 0, a single frame will be yielded instead.

Force End Yield

Forces the destroyer to yield after destroying all chunks for a given LOD Group, if and only if 1 or more game objects have been destroyed in the current frame and the Chunk Streamer's Memory Freeing Strategy has been set to Dont Free Memory.