Class NetworkSceneManager
Main class for managing network scenes when EnableSceneManagement is enabled. Uses the SceneEventMessage message to communicate SceneEventData between the server and client(s)
Implements
Inherited Members
Namespace: Unity.Netcode
Assembly: solution.dll
Syntax
public class NetworkSceneManager : IDisposable
Fields
Name | Description |
---|---|
PostSynchronizationSceneUnloading | When enabled and ClientSynchronizationMode is Additive, any scenes not synchronized with the server will be unloaded unless VerifySceneBeforeUnloading returns true. This provides more granular control over which already loaded client-side scenes not synchronized with the server should be unloaded. |
VerifySceneBeforeLoading | Delegate handler defined by NetworkSceneManager.VerifySceneBeforeLoadingDelegateHandler that is invoked before the server or client loads a scene during an active netcode game session. |
VerifySceneBeforeUnloading | Client Side Only: |
Properties
Name | Description |
---|---|
ActiveSceneSynchronizationEnabled | When enabled, the server or host will synchronize clients with changes to the currently active scene |
ClientSynchronizationMode | This setting changes how clients handle scene loading when initially synchronizing with the server. |
Methods
Name | Description |
---|---|
DisableValidationWarnings(bool) | When set to true, this will disable the console warnings about a scene being invalidated. |
Dispose() | Handle NetworkSeneManager clean up |
LoadScene(string, LoadSceneMode) | Server side: Loads the scene name in either additive or single loading mode. When applicable, the AsyncOperation is delivered within the SceneEvent via OnSceneEvent |
SetClientSynchronizationMode(LoadSceneMode) | |
UnloadScene(Scene) | Server Side: Unloads an additively loaded scene. If you want to unload a Single mode loaded scene load another Single scene. When applicable, the AsyncOperation is delivered within the SceneEvent via the OnSceneEvent |
Events
Name | Description |
---|---|
OnLoad | Invoked when a Load event is started by the server. |
OnLoadComplete | Invoked when a LoadComplete event is generated by a client or server. |
OnLoadEventCompleted | Invoked when a LoadEventCompleted event is generated by the server.
This event signifies the end of an existing Load event as it pertains
to all clients connected when the event was started. This event signifies that all clients (and server) have
finished the Load event. |
OnSceneEvent | Subscribe to this event to receive all SceneEventType notifications.
|
OnSynchronize | Invoked when a Synchronize event is started by the server
after a client is approved for connection in order to synchronize the client with the currently loaded
scenes and NetworkObjects. This event signifies the beginning of the synchronization event. |
OnSynchronizeComplete | Invoked when a SynchronizeComplete event is generated by a client. |
OnUnload | Invoked when a Unload event is started by the server. |
OnUnloadComplete | Invoked when a UnloadComplete event is generated by a client or server. |
OnUnloadEventCompleted | Invoked when a UnloadEventCompleted event is generated by the server.
This event signifies the end of an existing Unload event as it pertains
to all clients connected when the event was started. This event signifies that all clients (and server) have
finished the Unload event. |