Photon Fusion 2.0.0

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.
 
SceneRef GetSceneRef (string sceneNameOrPath)
 Gets a SceneRef for the given scene name or path.
 
void Initialize (NetworkRunner runner)
 Callback for initialization.
 
bool IsRunnerScene (Scene scene)
 Signals if the given scene is the main runner scene. Mostly used for Multipeer logic.
 
NetworkSceneAsyncOp LoadScene (SceneRef sceneRef, NetworkLoadSceneParameters parameters)
 Loads a given scene with the specified parameters.
 
void MakeDontDestroyOnLoad (GameObject obj)
 Mark an object as DontDestroyOnLoad.
 
bool MoveGameObjectToScene (GameObject gameObject, SceneRef sceneRef)
 Move a GameObject to a desired scene.
 
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.
 
void Shutdown ()
 Callback for shutdown and clean up.
 
bool TryGetPhysicsScene2D (out PhysicsScene2D scene2D)
 Tries to get the physics scene 2D.
 
bool TryGetPhysicsScene3D (out PhysicsScene scene3D)
 Tries to get the physics scene 3D.
 
NetworkSceneAsyncOp UnloadScene (SceneRef sceneRef)
 Unloads a given scene.
 

Properties

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

Detailed Description

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

Member Function Documentation

◆ LoadScene()

NetworkSceneAsyncOp LoadScene ( SceneRef  sceneRef,
NetworkLoadSceneParameters  parameters 
)

Loads a given scene with the specified parameters.

Returns
Returns a NetworkSceneAsyncOp that can be waited

◆ 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

◆ 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