|
Kanda Foundation 0.8.0
|
Content Scenes provide functionality for loading and tracking content during a session. It utilizes various components and systems to manage the loading process, ensuring that the scene is loaded efficiently and can be tracked.
Before content scenes can be loaded, they must be present in the content archive.
Ensure that scenes are added either by including them in the build settings or by downloading and adding them to runtime ahead of time. Use Unity Entities Content Management features to manage this process.
For more information, refer to Unity's Content Management documentation.
The ContentSceneMetadata struct is used to identify and load content scenes. It contains:
Name: A FixedString128Bytes representing the name of the entity scene.Guid: A Hash128 representing the GUID of the entity scene.When referencing a content scene, you need to use the entity scene GUID.
The LoadContentSceneClientSystem handles loading content scenes on the client side:
ILocalPlayerInfoService.SelectedContentScene.LoadContentSceneCommand to the server to request the scene be loaded on the server.The LoadContentSceneServerSystem manages content scene loading on the server:
LoadContentSceneCommand requests from clients.Both client and server use the ContentSceneRef component to track the loaded content scene. This component contains the metadata of the scene and the entity representing the loaded scene.
The ContentSceneStreamingSystem is responsible for managing the streaming and activation of the content scene:
ContentSceneRef is created, it is marked for preloading.WaitForContentActivation app setting is set to false, the system will wait for the application to signal that it is ready to activate the scene (by setting ContentSceneRef.ShouldActivate to true).LocalPlayerInfoService when transitioning to a session.