public sealed class SceneChunkStreamer : ChunkStreamer
A Chunk Streamer component which loads chunks via scenes using the
SceneManager.LoadSceneAsync method.
You should never have to interact directly with this component, as the methods/properties
are called/used
as needed by the Streamable Assets Manager.
Name | Type | Description |
---|---|---|
AsyncLoadStrategy | AsyncLoadStrategy |
Gets or sets the Async Load Strategy, which the strategy the Streamer will use to load Asset Chunks. |
ChunkDestroyer | ChunkDestroyer |
Gets the Chunk Destroyer associated with this component. |
CompatibleWithHiearchyOrganizer | bool |
Returns true only if Keep Scenes Intact is false (disabled).
|
InvalidSceneFormatMessageLevel | InvalidSceneFormatMessageLevel |
Gets or sets the InvalidSceneFormatMessageLevel used by this Scene Chunk Streamer. |
IsSingleFrameAttachmentPreloadRequired | bool |
Scene objects cannot be fully loaded/initialized in a single frame; they need one frame before they actually "exist" in the scene they're loaded into. Because of this, pre loading is required, and so this property is overridden to always return true. |
KeepScenesIntact | bool |
Gets the value of the Keep Scenes Intact option (set in the inspector). |
MemoryFreeingStrategy | MemoryFreeingStrategy |
The strategy for freeing memory, which basically determines if/when Resources.UnloadUnusedAssets() is called. |
protected sealed override void AwakeExtended()
Executes Awake related logic.
protected override ChunkStreamerUser CreateNewUser(ILODGroup LODGroup)
Creates a new SceneChunkStreamerUser, which is a custom type which derives from ChunkStreamerUser. This user object contains a CellString and some other data used specifically by this class.
Name | Type | Description |
---|---|---|
LODGroup | ILODGroup |
The lod group being registered. |
ChunkStreamerUser
A new user object created using the worldAssociatedWithUser as input.
public sealed override IEnumerator<YieldInstruction> DetachAndUnloadChunksFromCells(List<WorldCell> cells, int userID)
Unloads the cell chunks and their associated scene via SceneManager.UnloadSceneAsync.
Name | Type | Description |
---|---|---|
cells | List<WorldCell> |
The cells whose chunks need to be detached and unloaded. |
userID | int |
The ID of the user requesting the unload and detachment. |
IEnumerator<YieldInstruction>
An IEnumerator<YieldInstruction> that can be iterated over or used as a coroutine.
See the
YieldInstruction page for more info.
public sealed override void LoadAndAttachChunksToCellsInSingleFrame(List<WorldCell> cells, int userID)
Attaches the chunks associated with the input cells to the cells in a single frame. Because IsSingleFrameAttachmentPreloadRequired is set to return true, PerformSingleFrameAttachmentPreload must be called in an earlier frame prior to this method being called.
Name | Type | Description |
---|---|---|
cells | List<WorldCell> |
The cells whose objects need to be attached. |
userID | int |
The ID of the user requesting the attachment. |
public sealed override IEnumerator<YieldInstruction> LoadAndAttachChunksToCellsInSingleFrame(List<WorldCell> cells, int userID)
Loads and attaches the objects associated with the input cells to the cells over a period of frames. using async scene loading.
Name | Type | Description |
---|---|---|
cells | List<WorldCell> |
The cells whose objects need to be loaded and attached. |
userID | int |
The ID of the user requesting the load and attachment. |
IEnumerator<YieldInstruction>
An IEnumerator<YieldInstruction> that can be iterated over or used as a coroutine.
See the
YieldInstruction page for more info.
public sealed override void PerformSingleFrameAttachmentPreload(List<WorldCell> cells, int userID)
Pre loads the chunks needed by the input cells for the user identified by loaderID. This ensures that when LoadAndAttachChunksToCellsInSingleFrame is called in a subsequent frame, it will work properly.
Name | Type | Description |
---|---|---|
cells | List<WorldCell> |
The cells whose chunks need to be pre loaded. |
userID | int |
The ID of the user requesting the pre load. |