Photon Fusion 2.0.3

Public Member Functions | Properties | List of all members
INetworkSceneManager Interface Reference

Interface for a NetworkRunner scene manager. A scene manager is responsible for loading and unloading scenes More...

Inherited by NetworkSceneManagerDummy.

Public Member Functions

SceneRef GetSceneRef (GameObject gameObject)
 Gets a SceneRef for the scene that the given GameObject belongs to. More...
 
SceneRef GetSceneRef (string sceneNameOrPath)
 Gets a SceneRef for the given scene name or path. More...
 
void Initialize (NetworkRunner runner)
 Callback for initialization More...
 
bool IsRunnerScene (Scene scene)
 Signals if the given scene is the main runner scene. Mostly used for Multipeer logic More...
 
NetworkSceneAsyncOp LoadScene (SceneRef sceneRef, NetworkLoadSceneParameters parameters)
 Loads a given scene with the specified parameters. More...
 
void MakeDontDestroyOnLoad (GameObject obj)
 Mark an object as DontDestroyOnLoad. More...
 
bool MoveGameObjectToScene (GameObject gameObject, SceneRef sceneRef)
 Move a GameObject to a desired scene. More...
 
bool OnSceneInfoChanged (NetworkSceneInfo sceneInfo, NetworkSceneInfoChangeSource changeSource)
 Implement this method and return true if you want to handle scene info changes manually. Return false if the default scene info change handling should be done by the NetworkRunner instead. More...
 
void Shutdown ()
 Callback for shutdown and clean up More...
 
bool TryGetPhysicsScene2D (out PhysicsScene2D scene2D)
 Tries to get the physics scene 2D. More...
 
bool TryGetPhysicsScene3D (out PhysicsScene scene3D)
 Tries to get the physics scene 3D. More...
 
NetworkSceneAsyncOp UnloadScene (SceneRef sceneRef)
 Unloads a given scene. More...
 

Properties

bool IsBusy [get]
 Signals if the INetworkSceneManager instance is busy with any scene loading operations More...
 
Scene MainRunnerScene [get]
 The main scene of the NetworkRunner. Mostly used for Multipeer logic More...
 

Detailed Description

Interface for a NetworkRunner scene manager. A scene manager is responsible for loading and unloading scenes

Member Function Documentation

◆ GetSceneRef() [1/2]

SceneRef GetSceneRef ( GameObject  gameObject)

Gets a SceneRef for the scene that the given GameObject belongs to.

◆ GetSceneRef() [2/2]

SceneRef GetSceneRef ( string  sceneNameOrPath)

Gets a SceneRef for the given scene name or path.

◆ Initialize()

void Initialize ( NetworkRunner  runner)

Callback for initialization

◆ IsRunnerScene()

bool IsRunnerScene ( Scene  scene)

Signals if the given scene is the main runner scene. Mostly used for Multipeer logic

◆ LoadScene()

NetworkSceneAsyncOp LoadScene ( SceneRef  sceneRef,
NetworkLoadSceneParameters  parameters 
)

Loads a given scene with the specified parameters.

Returns
Returns a NetworkSceneAsyncOp that can be waited

◆ MakeDontDestroyOnLoad()

void MakeDontDestroyOnLoad ( GameObject  obj)

Mark an object as DontDestroyOnLoad.

◆ MoveGameObjectToScene()

bool MoveGameObjectToScene ( GameObject  gameObject,
SceneRef  sceneRef 
)

Move a GameObject to a desired scene.

Returns
Return true if the operation was successfully

◆ OnSceneInfoChanged()

bool OnSceneInfoChanged ( NetworkSceneInfo  sceneInfo,
NetworkSceneInfoChangeSource  changeSource 
)

Implement this method and return true if you want to handle scene info changes manually. Return false if the default scene info change handling should be done by the NetworkRunner instead.

Returns
Return true if a custom handling is provided, false otherwise to use the default one

◆ Shutdown()

void Shutdown ( )

Callback for shutdown and clean up

◆ TryGetPhysicsScene2D()

bool TryGetPhysicsScene2D ( out PhysicsScene2D  scene2D)

Tries to get the physics scene 2D.

Returns
Returns true if the operation was successfully

◆ TryGetPhysicsScene3D()

bool TryGetPhysicsScene3D ( out PhysicsScene  scene3D)

Tries to get the physics scene 3D.

Returns
Returns true if the operation was successfully

◆ UnloadScene()

NetworkSceneAsyncOp UnloadScene ( SceneRef  sceneRef)

Unloads a given scene.

Returns
Returns a NetworkSceneAsyncOp that can be waited

Property Documentation

◆ IsBusy

bool IsBusy
get

Signals if the INetworkSceneManager instance is busy with any scene loading operations

◆ MainRunnerScene

Scene MainRunnerScene
get

The main scene of the NetworkRunner. Mostly used for Multipeer logic