ActiveSceneSwitcher Class

public sealed class ActiveSceneSwitcher : WorldGroupingListener

A special World Grouping Listener that can be added to World Grouping's that uses Light Probes in order force Tetrahedralization of Light Probes whenever Cells are added or removed from the Groupings.

This class has been configured in such a way that one instance of the component can and should be used with all Worlds/Groupings that are making use of Light Probes. This configuration ensures that the Tetrehedralization of the Light Probes is executed the minimum number of times possible. If you use more than one instance of this component, everything will work, however the Tetrehedralization will usually execute more than is needed, which may degrade performance.

Properties

Name Type Description
IgnoreLODTransitions bool

Overriden to return false

YieldBehaviorAfterMethodExecution ListenerYieldBehavior

Overriden to return ListenerYieldBehavior.NeverYield

Methods

OnAfterAllCellsDeactivated(ReadOnlyList<WorldCell>, int, int, bool)

public override IEnumerator<YieldInstruction> OnAfterAllCellsDeactivated(ReadOnlyList<WorldCell> cells, int batchNumber, int totalBatchesToExpect, bool cellsArePartOfLODTransition)

This method is to detect the removal of Asset Chunks containing Light Probe Groups.

Parameters

Name Type Description
cells ReadOnlyList<WorldCell>

The batch of cells which have been deactivated.

batchNumber int

The batch number. Will be between 1 and totalBatchesToExpect. You can use the batch number to determine if the batch of cells is the first or last, and perform specific logic based on that. For instance, you may want to perform a method call that should only be performed after all cells have been processed by your World Grouping Listener.

totalBatchesToExpect int

The total batches to expect. Once the batchNumber is equal to this value, you know that you are on the final batch of cells. This method will not be called again after that, except for a new World Update.

cellsArePartOfLODTransition bool

Whether the current batch of cells are being deactivated as part of an LOD transition.

Returns

IEnumerator<YieldInstruction>
An IEnumerator<YieldInstruction> that can be iterated over or used as a coroutine. See the YieldInstruction page for more info.