Skip to main content

Unity.Netcode.SceneEvent

Used for local notifications of various scene events. The OnSceneEvent of delegate type NetworkSceneManager.SceneEventDelegate uses this class to provide scene event status.
Note: This is only when EnableSceneManagement is enabled.
See also:
SceneEventType

Inheritance#

System.Object

SceneEvent

Inherited Members#

System.Object.Equals(System.Object)

System.Object.Equals(System.Object, System.Object)

System.Object.GetHashCode()

System.Object.GetType()

System.Object.MemberwiseClone()

System.Object.ReferenceEquals(System.Object, System.Object)

System.Object.ToString()

Syntax#
public class SceneEvent

Fields#

AsyncOperation#

The returned by
This is set for the following SceneEventTypes:

  • Load
  • Unload
Declaration#
public AsyncOperation AsyncOperation
Field Value#
TypeDescription
AsyncOperation

ClientId#

The client identifier can vary depending upon the following conditions:

  1. SceneEventTypes that always set the ClientId to the local client identifier, are initiated (and processed locally) by the server-host, and sent to all clients to be processed.
    • Load
    • Unload
    • Synchronize
    • ReSynchronize
  2. Events that always set the ClientId to the local client identifier, are initiated (and processed locally) by a client or server-host, and if initiated by a client will always be sent to and processed on the server-host:
    • LoadComplete
    • UnloadComplete
    • SynchronizeComplete
  3. Events that always set the ClientId to the ServerId:
    • LoadEventCompleted
    • UnloadEventCompleted
Declaration#
public ulong ClientId
Field Value#
TypeDescription
System.UInt64

ClientsThatCompleted#

List of clients that completed a loading or unloading event.
This is set for the following SceneEventTypes:

  • LoadEventCompleted
  • UnloadEventCompleted
Declaration#
public List<ulong> ClientsThatCompleted
Field Value#
TypeDescription
System.Collections.Generic.List\<System.UInt64>

ClientsThatTimedOut#

List of clients that timed out during a loading or unloading event.
This is set for the following SceneEventTypes:

  • LoadEventCompleted
  • UnloadEventCompleted
Declaration#
public List<ulong> ClientsThatTimedOut
Field Value#
TypeDescription
System.Collections.Generic.List\<System.UInt64>

LoadSceneMode#

If applicable, this reflects the type of scene loading or unloading that is occurring.
This is set for the following SceneEventTypes:

  • Load
  • Unload
  • LoadComplete
  • UnloadComplete
  • LoadEventCompleted
  • UnloadEventCompleted
Declaration#
public LoadSceneMode LoadSceneMode
Field Value#
TypeDescription
LoadSceneMode

Scene#

When a scene is loaded, the Scene structure is returned.
This is set for the following SceneEventTypes:

  • LoadComplete
Declaration#
public Scene Scene
Field Value#
TypeDescription
Scene

SceneEventType#

Will always be set to the current SceneEventType

Declaration#
public SceneEventType SceneEventType
Field Value#
TypeDescription
SceneEventType

SceneName#

This will be set to the scene name that the event pertains to.
This is set for the following SceneEventTypes:

  • Load
  • Unload
  • LoadComplete
  • UnloadComplete
  • LoadEventCompleted
  • UnloadEventCompleted
Declaration#
public string SceneName
Field Value#
TypeDescription
System.String