AddressableSceneChunkStreamer Class

public sealed class AddressableSceneChunkStreamer : AddressableBaseChunkStreamer

An implementation of AddressableBaseChunkStreamer that is able to stream in Addressable Scenes. You cannot override this class, however you can consult this page as a reference if implementing your own custom addressable chunk streamer.

Properties

Name Type Description
FileExtension string

Returns .unity which is the file extension for scenes.

InvalidSceneFormatMessageLevel InvalidSceneFormatMessageLevel

Gets or sets the InvalidSceneFormatMessageLevel used by this Async Scene Loader.

IsSingleFrameAttachmentPreloadRequired bool

This property, along with the LoadAndAttachChunksToCellsInSingleFrame method, will throw an InvalidOperationException if queried, so don't! The Addressable System is unable to load scenes in a synchronous manner, therefore use of 'Initialize on Awake' (via the Component Manager) is not allowed, as that will query this Property as well as call the LoadAndAttachChunksToCellsInSingleFrame method. Instead, disable 'Initialize on Awake' and call the InitializeGradually method of the Component Manager manually.

Methods

AwakeExtended2()

protected sealed override void AwakeExtended2()

Awake related logic.


CreateAddressableLoaderUser(ILODGroup)

protected sealed override AddressableStreamerBaseUser CreateAddressableLoaderUser(ILODGroup LODGroup)

Creates a new AddressableSceneLoaderUser object, which implements behaviour needed to load scene addressable assets.

Parameters

Name Type Description
LODGroup ILODGroup

The lod group being registered.

Returns

AddressableStreamerBaseUser
A new AddressablePrefabLoaderUser user object created using the LODGroup as input.


DetachAndUnloadCellChunksFromCells(List<WorldCell>, int)

public sealed override IEnumerator<YieldInstruction> DetachAndUnloadCellChunksFromCells(List<WorldCell> cells, int userID)

Detaches and unloads the chunks associated with the input world cells over a period of frames using the associated ChunkDestroyer, or GameObject.Destroy if no destroyer is present.

Parameters

Name Type Description
cells List<WorldCell>

The World Cells whose objects need to be detached and unloaded.

userID int

The ID of the user requesting the unload and detachment.

Returns

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


LoadAndAttachChunksToCellsInSingleFrame(List<WorldCell>, int)

public sealed override void LoadAndAttachChunksToCellsInSingleFrame(List<WorldCell> cells, int userID)

This method, along with the IsSingleFrameAttachmentPreloadRequired property, will throw an InvalidOperationException if called, so don't! The Addressable System is unable to load scenes in a synchronous manner, therefore use of 'Initialize on Awake' (via the Component Manager) is not allowed, as that will call this method as well as query the IsSingleFrameAttachmentPreloadRequired property. Instead, disable 'Initialize on Awake' and call the InitializeGradually method of the Component Manager manually.

Parameters

Name Type Description
cells List<WorldCell>

The cells to load and attach

userID int

The ID assigned to the user of this chunk streamer at the time of registration.

Returns

null
Nothing, as it will throw an exception.

Exceptions

Type Condition
InvalidOperationException Thrown if the method is called.

OnDestroyExtended()

protected sealed override void OnDestroyExtended()

OnDestroy related logic.