Photon Fusion 2.1.1

NetworkSceneInfo Struct Reference

Can store up to 8 active scenes and allows for duplicates. Each write increases Version which can be used to generate unique scene objects ids for when a scene is supposed to be reloaded. More...

Inherits INetworkStruct.

Public Member Functions

int AddSceneRef (SceneRef sceneRef, LoadSceneMode loadSceneMode=LoadSceneMode.Single, LocalPhysicsMode localPhysicsMode=LocalPhysicsMode.None, bool activeOnLoad=false)
 Adds a scene to the list.
readonly bool Equals (NetworkSceneInfo other)
 Compares two NetworkSceneInfo for equality.
override readonly bool Equals (object obj)
 Compares two NetworkSceneInfo for equality.
override readonly int GetHashCode ()
 Get the hash code of the NetworkSceneInfo.
readonly int IndexOf ((SceneRef SceneRef, NetworkLoadSceneParameters SceneParams) scene)
readonly int IndexOf (SceneRef sceneRef, NetworkLoadSceneParameters sceneParams)
 Gets the index of the given scene.
bool RemoveSceneRef (SceneRef sceneRef)
 Removes a scene from the list.
override readonly string ToString ()
 String representation of the NetworkSceneInfo.

Static Public Member Functions

static implicit operator NetworkSceneInfo (SceneRef sceneRef)
 Implicit conversion to NetworkSceneInfo.

Static Public Attributes

const int MaxScenes = 8
 Max number of scenes that can be stored.

Properties

int SceneCount [get]
 Total Scene Count.
readonly ReadOnlySpan< NetworkLoadSceneParametersSceneParams [get]
 The scenes load parameters list.
readonly ReadOnlySpan< SceneRefScenes [get]
 The scenes list.
int Version [get]
 Version number.

Detailed Description

Can store up to 8 active scenes and allows for duplicates. Each write increases Version which can be used to generate unique scene objects ids for when a scene is supposed to be reloaded.

Member Function Documentation

◆ AddSceneRef()

int AddSceneRef ( SceneRef sceneRef,
LoadSceneMode loadSceneMode = LoadSceneMode::Single,
LocalPhysicsMode localPhysicsMode = LocalPhysicsMode::None,
bool activeOnLoad = false )

Adds a scene to the list.

Parameters
sceneRefScene to add
loadSceneModeLoad scene mode
localPhysicsModeLocal physics mode
activeOnLoadSignals if the scene should be active on load
Returns
Returns the index of the scene or -1 if the scene could not be added

◆ Equals() [1/2]

readonly bool Equals ( NetworkSceneInfo other)

Compares two NetworkSceneInfo for equality.

Parameters
otherThe other NetworkSceneInfo
Returns
Returns true if the two NetworkSceneInfo are equal

◆ Equals() [2/2]

override readonly bool Equals ( object obj)

Compares two NetworkSceneInfo for equality.

Parameters
objThe other NetworkSceneInfo
Returns
Returns true if the two NetworkSceneInfo are equal

◆ GetHashCode()

override readonly int GetHashCode ( )

Get the hash code of the NetworkSceneInfo.

Returns
Hast code of the NetworkSceneInfo

◆ IndexOf()

readonly int IndexOf ( SceneRef sceneRef,
NetworkLoadSceneParameters sceneParams )

Gets the index of the given scene.

Parameters
sceneRefSceneRef to look for
sceneParamsScene parameters to look for
Returns
Returns the index of the scene or -1 if not found

◆ operator NetworkSceneInfo()

implicit operator NetworkSceneInfo ( SceneRef sceneRef)
static

Implicit conversion to NetworkSceneInfo.

Parameters
sceneRefSceneRef to convert
Returns
Returns a NetworkSceneInfo instance

◆ RemoveSceneRef()

bool RemoveSceneRef ( SceneRef sceneRef)

Removes a scene from the list.

Parameters
sceneRefScene to remove
Returns
Returns true if the scene was removed