public sealed class AddressablePrefabChunkStreamer : AddressableBaseChunkStreamer
An implementation of AddressableBaseChunkStreamer that is able to stream in Addressable Prefabs. You cannot override this class, however you can consult this page as a reference if implementing your own custom addressable chunk streamer.
Name | Type | Description |
---|---|---|
ChunkDestroyer | ChunkDestroyer |
Gets the Chunk Destroyer associated with this component.
|
FileExtension | string |
File extension that is appended to addresses. |
IsSingleFrameAttachmentPreloadRequired | bool |
Because Instantiated prefabs do not need a frame to "process", pre-loading is not required, and so this property is overridden to return false. |
MemoryFreeingStrategy | MemoryFreeingStrategy |
The strategy for freeing memory. If you create a custom class deriving from Chunk Manager, you can choose to ignore the strategy or enforce it. Memory freeing is simply calling Resources.UnloadUnusedAssets (which can be used like any other coroutine!) |
protected sealed override void AwakeExtended2()
Awake related logic is contained within this method.
protected sealed override AddressableStreamerBaseUser CreateAddressableLoaderUser(ILODGroup LODGroup)
Creates a new AddressablePrefabLoaderUser object, which implements behaviour needed to load prefab addressable assets.
Name | Type | Description |
---|---|---|
LODGroup | ILODGroup |
The lod group being registered. |
AddressableStreamerBaseUser
A new AddressablePrefabLoaderUser user object created using the LODGroup as input.
public sealed override IEnumerator<YieldInstruction> DetachAndUnloadChunksFromCells(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.
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. |
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)
Instantiates and attaches all cell chunks to the input cells in a single frame. This is not very performant and so should only be used in Awake or Start, and generally only for testing purposes. Also note that since the AddressableErrorRepairer only works on a multi frame basis, it will no the called, and the streamer will automatically try to load the backup assets if any assets fail to load.
Name | Type | Description |
---|---|---|
cells | List<WorldCell> |
The cells whose chunks need to be attached. |
userID | int |
The ID of the user requesting the attachment. |
protected sealed override void OnDestroyExtended()
OnDestroy related logic is contained within this method.
protected sealed override void StartExtended()
Start related logic is contained within this method.