Photon Fusion 1.1.12

Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Properties | List of all members
NetworkRunner Class Reference

Represents a Server or Client Simulation. More...

Inherits Behaviour, ILogBuilder, ILogBuilder, and Simulation.ICallbacks.

Public Types

enum class  BuildTypes
 Enumeration of Fusion.Runtime.dll options. More...
 
enum class  States
 Initialization stages of Fusion More...
 

Public Member Functions

void AddCallbacks (params INetworkRunnerCallbacks[] callbacks)
 Register an INetworkRunnerCallbacks instance for callbacks from this NetworkRunner. More...
 
void AddGlobal< T > ()
 
AddOrGetGlobal< T > ()
 Ensures that a specific SimulationBehaviour component exists on this NetworkRunner gameobject. More...
 
void AddPlayerAreaOfInterest (PlayerRef player, Vector3 position, float extent, int layersMask=-1)
 Adds an area of interest region for a specific player. A player can have multiple areas of interest regions added. These are cleared every tick, so this needs to be called every NetworkBehaviour.FixedUpdateNetwork(). More...
 
void AddSimulationBehaviour (SimulationBehaviour behaviour, NetworkObject obj=null)
 Register a SimulationBehaviour instance with the SimulationBehaviourUpdater. Invalid if NetworkRunner has not been started and initialized. More...
 
void Attach (NetworkObject networkObject, PlayerRef? inputAuthority=null)
 Attaches a user created network object to the network More...
 
delegate void CloudConnectionLostHandler (NetworkRunner networkRunner, ShutdownReason shutdownReason, bool reconnecting)
 If this callback is implemented, the default behavior of disconnecting when the cloud connection is lost in server/client or host/client mode is disabled. This callback will be invoked instead, leaving the decision up to the user. It is called both on the server/host and on the client. More...
 
void Despawn (NetworkObject networkObject, bool allowPredicted=false)
 Destroys a NetworkObject. More...
 
void Disconnect (PlayerRef player)
 Disconnect a player from the server More...
 
bool EnsureRunnerSceneIsActive (out Scene previousActiveScene)
 If running in NetworkProjectConfig.PeerModes.Multiple peer mode and the current active scene is different than MultiplePeerUnityScene, switches active scene to MultiplePeerUnityScene, stores the previous active scene in previousActiveScene and returns true. Returns false otherwise. More...
 
bool Exists (NetworkId id)
 Returns if the Fusion.Simulation contains a NetworkObject with given id in the current State SimulationSnapshot. More...
 
bool Exists (NetworkObject obj)
 Returns if the Fusion.Simulation contains a reference to a NetworkObject in the current State SimulationSnapshot. More...
 
NetworkObject FindObject (NetworkId oref)
 Get the NetworkObject instance for this NetworkRunner from a NetworkId. More...
 
SimulationBehaviour[] GetAllBehaviours (Type type)
 Returns array of all SimulationBehaviour registered with this NetworkRunner. More...
 
List< T > GetAllBehaviours< T > ()
 
void GetAllBehaviours< T > (List< T > result)
 
GetGlobal< T > ()
 
int GetHashCodeForLogger ()
 
T? GetInputForPlayer< T > (PlayerRef player)
 Returns the NetworkInput data from player, converted to the indicated INetworkInput. More...
 
SimulationBehaviour GetInterfaceListHead (Type type, int index)
 
SimulationBehaviourListScope GetInterfaceListHead (Type type, int index, out SimulationBehaviour head)
 
SimulationBehaviour GetInterfaceListNext (SimulationBehaviour behaviour)
 
SimulationBehaviour GetInterfaceListPrev (SimulationBehaviour behaviour)
 
int GetInterfaceListsCount (Type type)
 
bool GetInterpolationData (NetworkBehaviour behaviour, bool predicted, out InterpolationData data)
 Gets the InterpolationData for the current SimulationStages stage. For use in the NetworkBehaviour.Render() callback. More...
 
PhysicsScene GetPhysicsScene ()
 Get the 3D Physics scene being used by this Runner. More...
 
PhysicsScene2D GetPhysicsScene2D ()
 Get the 2D Physics scene being used by this Runner. More...
 
int? GetPlayerActorId (PlayerRef player)
 Gets Player's Actor Number (ID). More...
 
byte[] GetPlayerConnectionToken (PlayerRef player=default)
 Returns a copy of the Connection Token used by a Player when connecting to this Server. Only available on Server. It will return null if running on a Client or the Connection token is missing More...
 
ConnectionType GetPlayerConnectionType (PlayerRef player)
 Return the ConnectionType with a Remote PlayerRef. Valid only when invoked from a Server (NetworkRunner.IsServer) More...
 
NetworkObject GetPlayerObject (PlayerRef player)
 Gets the network object associated with a specific player More...
 
double GetPlayerRtt (PlayerRef playerRef)
 Returns the player round trip time (ping) in seconds More...
 
string GetPlayerUserId (PlayerRef player=default)
 Gets Player's UserID. More...
 
NetworkInputGetRawInputForPlayer (PlayerRef player)
 Returns the unconverted unsafe NetworkInput for the indicated player. More...
 
IEnumerable< NetworkObjectGetResumeSnapshotNetworkObjects ()
 Iterate over the old NetworkObjects from the Resume Snapshot More...
 
IEnumerable<(NetworkObject, NetworkObjectHeaderPtr)> GetResumeSnapshotNetworkSceneObjects ()
 Iterate over the Scene NetworkObjects from the Resume Snapshot while giving the reference of the old Snapshot data associated with that particular Scene Object More...
 
RpcTargetStatus GetRpcTargetStatus (PlayerRef target)
 
bool HasAnyActiveConnections ()
 
GameObject InstantiateInRunnerScene (GameObject original)
 Instantiates an object in the scene of this runner More...
 
GameObject InstantiateInRunnerScene (GameObject original, Vector3 position, Quaternion rotation)
 Instantiates an object in the scene of this runner More...
 
InstantiateInRunnerScene< T > (T original)
 Instantiates an object in the scene of this runner More...
 
InstantiateInRunnerScene< T > (T original, Vector3 position, Quaternion rotation)
 Instantiates an object in the scene of this runner More...
 
void InvokeSceneLoadDone ()
 Invoke INetworkRunnerCallbacks.OnSceneLoadDone(NetworkRunner) on all implementations More...
 
void InvokeSceneLoadStart ()
 Invoke INetworkRunnerCallbacks.OnSceneLoadStart(NetworkRunner) on all implementations More...
 
bool IsPlayerActive (PlayerRef player)
 
bool IsPlayerValid (PlayerRef player)
 
async Task< StartGameResultJoinSessionLobby (SessionLobby sessionLobby, string lobbyID=null, AuthenticationValues authentication=null, AppSettings customAppSettings=null, bool? useDefaultCloudPorts=false, bool useCachedRegions=false)
 Join the Peer to a specific Lobby, either a prebuild or a custom one. More...
 
void MoveToRunnerScene (GameObject go)
 Moves an object to the scene of this runner More...
 
void MoveToRunnerScene< T > (T component)
 Moves an object to the scene of this runner More...
 
delegate void OnBeforeSpawned (NetworkRunner runner, NetworkObject obj)
 Delegate type for on before spawned callback More...
 
Task< bool > PushHostMigrationSnapshot ()
 Compute and send a Host Migration Snapshot to the Photon Cloud More...
 
void RegisterSceneObjects (IEnumerable< NetworkObject > objects)
 
void RegisterUniqueObjects (IEnumerable< NetworkObject > objects)
 
void RemoveCallbacks (params INetworkRunnerCallbacks[] callbacks)
 Unregister an INetworkRunnerCallbacks instance for callbacks from this NetworkRunner. More...
 
void RemoveGlobal< T > ()
 Removes a specific SimulationBehaviour from this NetworkRunner gameobject, if it exists. More...
 
void RemoveSimulationBehavior (SimulationBehaviour behaviour)
 Unregister a SimulationBehaviour instance from the SimulationBehaviourUpdater callbacks. Invalid if NetworkRunner has not been started and initialized. More...
 
void SendReliableDataToPlayer (PlayerRef player, byte[] data)
 Send an arbitrary data buffer to a target Player More...
 
void SendReliableDataToServer (byte[] data)
 Send an arbitrary data buffer to the Server More...
 
void SendRpc (SimulationMessage *message)
 Sends RPC message. Not meant to be used directly, ILWeaver calls this. More...
 
void SendRpc (SimulationMessage *message, out RpcSendResult info)
 Sends RPC message. Not meant to be used directly, ILWeaver calls this. More...
 
void SetActiveScene (SceneRef scene)
 Update the current Active Scene More...
 
void SetInterestGroup (NetworkObject obj, PlayerRef player, string group, bool interested)
 Add or remove Player's interest in a specific named Interest Group for a specific NetworkObject.
SimulationConfig.ReplicationMode must be set to SimulationConfig.StateReplicationModes.EventualConsistency. More...
 
void SetPlayerAlwaysInterested (PlayerRef player, NetworkObject networkObject, bool alwaysInterested)
 Flags this player as always interested in this object. Means it does not have to be in a players area of interest to be replicated. More...
 
void SetPlayerObject (PlayerRef player, NetworkObject networkObject)
 Sets the network object associated with this player More...
 
bool SetSimulationState (NetworkObject obj, bool simulate)
 Sets the simulation state for this object, if it takes part in the NetworkFixedUpdate, etc. More...
 
Task Shutdown (bool destroyGameObject=true, ShutdownReason shutdownReason=ShutdownReason.Ok, bool forceShutdownProcedure=false)
 Initiates a Simulation.Dispose. More...
 
void SinglePlayerContinue ()
 Continues a paused game in single player More...
 
void SinglePlayerPause ()
 Pauses the game in single player More...
 
void SinglePlayerPause (bool paused)
 Sets the paused state in a single player More...
 
NetworkObject Spawn (GameObject prefab, Vector3? position=null, Quaternion? rotation=null, PlayerRef? inputAuthority=null, OnBeforeSpawned onBeforeSpawned=null, NetworkObjectPredictionKey? predictionKey=null, bool syncPhysics=true)
 Attempts to network instantiate a NetworkObject using a GameObject. The supplied GameObject must have a NetworkObject component. More...
 
NetworkObject Spawn (NetworkObject prefab, Vector3? position=null, Quaternion? rotation=null, PlayerRef? inputAuthority=null, OnBeforeSpawned onBeforeSpawned=null, NetworkObjectPredictionKey? predictionKey=null, bool syncPhysics=true)
 Attempts to network instantiate a NetworkObject using a NetworkObject prefab. Note: position and rotation values are only used locally for the instantiation of the object, and are not inherently networked. Use NetworkPositionRotation, or any of its derived classes such as NetworkTransform to replicate the initial transform state. More...
 
NetworkObject Spawn (NetworkObjectGuid prefabGuid, Vector3? position=null, Quaternion? rotation=null, PlayerRef? inputAuthority=null, OnBeforeSpawned onBeforeSpawned=null, NetworkObjectPredictionKey? predictionKey=null, bool syncPhysics=true)
 Attempts to network instantiate a NetworkObject using a NetworkObjectGuid Note: position and rotation values are only used locally for the instantiation of the object, and are not inherently networked. Use NetworkPositionRotation, or any of its derived classes such as NetworkTransform to replicate the initial transform state. More...
 
NetworkObject Spawn (NetworkPrefabAsset prefabAsset, Vector3? position=null, Quaternion? rotation=null, PlayerRef? inputAuthority=null, OnBeforeSpawned onBeforeSpawned=null, NetworkObjectPredictionKey? predictionKey=null)
 Attempts to network instantiate a NetworkObject using a NetworkPrefabAsset Note: position and rotation values are only used locally for the instantiation of the object, and are not inherently networked. Use NetworkPositionRotation, or any of its derived classes such as NetworkTransform to replicate the initial transform state. More...
 
NetworkObject Spawn (NetworkPrefabId prefabId, Vector3? position=null, Quaternion? rotation=null, PlayerRef? inputAuthority=null, OnBeforeSpawned onBeforeSpawned=null, NetworkObjectPredictionKey? predictionKey=null, bool syncPhysics=true, NetworkObject resumeNO=null)
 Attempts to network instantiate a NetworkObject using a NetworkPrefabId Note: position and rotation values are only used locally for the instantiation of the object, and are not inherently networked. Use NetworkPositionRotation, or any of its derived classes such as NetworkTransform to replicate the initial transform state. More...
 
NetworkObject Spawn (NetworkPrefabRef prefabRef, Vector3? position=null, Quaternion? rotation=null, PlayerRef? inputAuthority=null, OnBeforeSpawned onBeforeSpawned=null, NetworkObjectPredictionKey? predictionKey=null)
 Attempts to network instantiate a NetworkObject using a NetworkPrefabRef. Note: position and rotation values are only used locally for the instantiation of the object, and are not inherently networked. Use NetworkPositionRotation, or any of its derived classes such as NetworkTransform to replicate the initial transform state. More...
 
Spawn< T > (T prefab, Vector3? position=null, Quaternion? rotation=null, PlayerRef? inputAuthority=null, OnBeforeSpawned onBeforeSpawned=null, NetworkObjectPredictionKey? predictionKey=null, bool syncPhysics=true)
 Attempts to network instantiate a NetworkObject using a Component type that is part of a NetworkObject More...
 
Task< StartGameResultStartGame (StartGameArgs args)
 Starts the local Fusion Runner and takes care of all major setup necessary More...
 
bool TryFindBehaviour (NetworkBehaviourId bref, out NetworkBehaviour behaviour)
 Get the NetworkBehaviour instance for this NetworkRunner from a NetworkBehaviourId. More...
 
bool TryFindBehaviour< T > (NetworkBehaviourId id, out T behaviour)
 
bool TryFindObject (NetworkId oref, out NetworkObject obj)
 Get the NetworkObject instance for this NetworkRunner from a NetworkId. More...
 
bool TryGetInputForPlayer< T > (PlayerRef player, out T input)
 Outputs the NetworkInput from player, translated to the indicated INetworkInput. More...
 
TryGetNetworkedBehaviourFromNetworkedObjectRef< T > (NetworkId id)
 Tries to return the first instance of T found on the root of a NetworkObject. More...
 
NetworkBehaviourId TryGetNetworkedBehaviourId (NetworkBehaviour behaviour)
 
NetworkId TryGetObjectRefFromNetworkedBehaviour (NetworkBehaviour behaviour)
 
bool TryGetPlayerObject (PlayerRef player, out NetworkObject networkObject)
 
bool TryMultiplePeerAssignTempScene ()
 Try to create a temp empty scene for PhysicsScene More...
 
- Public Member Functions inherited from Behaviour
AddBehaviour< T > ()
 Wrapper for Unity's GameObject.AddComponent() More...
 
GetBehaviour< T > ()
 Wrapper for Unity's GameObject.GetComponentInChildren() More...
 
bool TryGetBehaviour< T > (out T behaviour)
 Wrapper for Unity's GameObject.TryGetComponent() More...
 

Static Public Member Functions

static List< NetworkRunner >.Enumerator GetInstancesEnumerator ()
 Get enumerator for the collection of all NetworkRunners. Allows to enumerate alloc-free. More...
 
static NetworkRunner GetRunnerForGameObject (GameObject gameObject)
 Get the NetworkRunner a GameObject instance belongs to. More...
 
static NetworkRunner GetRunnerForScene (Scene scene)
 Get the NetworkRunner from a specific Scene More...
 
- Static Public Member Functions inherited from Behaviour
static void DestroyBehaviour (Behaviour behaviour)
 Wrapper for Unity's GameObject.Destroy() More...
 

Public Attributes

Func< string, ServerConnection, string > CloudAddressRewriter = null
 

Static Public Attributes

static Simulation.IDeltaCompressor BurstDeltaCompressor
 
static CloudConnectionLostHandler CloudConnectionLost
 

Properties

IEnumerable< PlayerRefActivePlayers [get]
 Returns the collection of PlayerRef objects for this NetworkRunner's Fusion.Simulation. More...
 
AuthenticationValues AuthenticationValues [get]
 AuthenticationValues used by this Runner to Authenticate the local peer. More...
 
static BuildTypes BuildType [get]
 Get Fusion.Runtime.dll build type. More...
 
NetworkProjectConfig Config [get]
 Returns the NetworkProjectConfig reference. More...
 
ConnectionType CurrentConnectionType [get]
 Check the current Connection Type with the Remote Server More...
 
SceneRef CurrentScene [get]
 Returns the current loaded network scene. More...
 
float DeltaTime [get]
 Returns the fixed tick time interval. Derived from the SimulationConfig.TickRate. More...
 
GameMode GameMode [get]
 Current Game Mode active on the Fusion Simulation More...
 
static IReadOnlyList< NetworkRunnerInstances [get]
 A list of all NetworkRunners. More...
 
float InterpolationRenderTime [get]
 The current time (current State.Time + Simulation.DeltaTime) for non-predicted objects (objects in a remote time frame). Use as an equivalent to Unity's Time.time. Time is relative to Tick 0 (which represents Time 0f). More...
 
bool IsClient [get]
 Returns if this Fusion.Simulation represents a Client connection. More...
 
bool IsCloudReady [get]
 
bool IsConnectedToServer [get]
 Returns if this Client is currently connected to a Remote Server More...
 
bool IsFirstTick [get]
 If this is the first tick that executes this update or re-simulation More...
 
bool IsForward [get]
 If this is not a re-simulation but a new forward tick More...
 
bool IsHostMigrationEnabled [get]
 Signal if Fusion was initilized with Host Migration system enabled More...
 
bool IsInSession [get]
 
bool IsLastTick [get]
 If this is the last tick that is being executed this update More...
 
bool IsMultiplePeerSceneTemp [get]
 Signal if this Runner is already in a Temp Physics Scene More...
 
bool IsPlayer [get]
 Returns true if this runner represents a Client or Host. Dedicated servers have no local player and will return false. More...
 
bool IsResimulation [get]
 If we are currently executing a client side prediction re-simulation. More...
 
bool IsResume [get]
 if this instance is a resume (host migration) More...
 
bool IsRunning [get]
 Returns if this Fusion.Simulation is valid and running. More...
 
bool IsServer [get]
 Returns if this Fusion.Simulation represents a Server connection. More...
 
bool IsSharedModeMasterClient [get]
 Signal if the Local Peer is in a Room and is the Room Master Client More...
 
bool IsShutdown [get]
 If the runner is shutdown More...
 
bool IsSinglePlayer [get]
 Returns true if this runner was started as single player (Started as SimulationModes.Host with SimulationConfig.DefaultPlayers = 1). More...
 
bool IsStarting [get]
 If the runner is pending to start More...
 
bool IsVisible [get, set]
 Change the visibility of this NetworkRunner when running in Multiple Peer Mode More...
 
HitboxManager LagCompensation [get]
 Returns the global instance of a lag compensation buffer Fusion.HitboxManager. More...
 
LobbyInfo LobbyInfo = new LobbyInfo() [get]
 Signal if the local peer is already inside a Lobby More...
 
PlayerRef LocalPlayer [get]
 Returns a PlayerRef for the local simulation. For a dedicated server PlayerRef.IsValid will equal false. PlayerRefs are assigned in order from 0 to MaxPlayers-1 and are re-used as players join and leave. The only caveat is that the server player (if one exists), always gets the last index no matter how many clients are connected. More...
 
SimulationModes Mode [get]
 Returns the SimulationModes flags for The type of network peer the associated Fusion.Simulation represents. More...
 
Scene MultiplePeerUnityScene [get, set]
 A scene used when run in NetworkProjectConfig.PeerModes.Multiple mode. More...
 
NATType NATType [get]
 Exposes the current NAT Type from the local Peer More...
 
INetworkObjectPool ObjectPool [get]
 Returns the INetworkObjectPool instance. More...
 
bool ProvideInput [get, set]
 Indicates if this NetworkRunner is collecting PlayerRef INetworkInput. More...
 
INetworkSceneManager SceneManager [get]
 Returns the INetworkSceneManager instance. More...
 
SessionInfo SessionInfo = new SessionInfo() [get]
 Stores information about the current running session More...
 
Simulation Simulation [get]
 Returns the Fusion.Simulation for this NetworkRunner. More...
 
float SimulationRenderTime [get]
 The current time (current State.Time + Simulation.DeltaTime) for predicted objects (objects in the local time frame). Use as an equivalent to Unity's Time.time. Time is relative to Tick 0 (which represents Time 0f). More...
 
float SimulationTime [get]
 The time the current State SimulationSnapshot represents (the most recent FixedUpdateNetwork simulation). Use as an equivalent to Unity's Time.fixedTime. Time is relative to Tick 0 (which represents Time 0f). More...
 
Scene SimulationUnityScene [get]
 Returns the Unity scene for this NetworkRunner. With NetworkProjectConfig.PeerModes.Multiple, multiple physics scenes may exist, and this getter should be used in place of SceneManager.GetActiveScene(). More...
 
SimulationStages Stage [get]
 Returns the current SimulationStages stage of this Fusion.Simulation. More...
 
States State [get]
 The current state of the runner, if it's Starting, Running, Shutdown More...
 
Tick??? Tick [get]
 The tick associated with the current state of networked objects, or the current simulation tick being processed (when evaluated during FixedUpdateNetwork). More...
 
int TicksExecuted [get]
 Returns how many ticks we executed last update. More...
 
SimulationConfig.Topologies Topology [get]
 The current topology used More...
 
string UserId [get]
 

Detailed Description

Represents a Server or Client Simulation.

All Scene related API and fields

Host Migration related code in order to get a copy of the Simulation State

Member Enumeration Documentation

◆ BuildTypes

enum BuildTypes
strong

Enumeration of Fusion.Runtime.dll options.

Enumerator
Debug 

Use the Debug version of the Fusion.Runntime.dll.

Release 

Use the Debug version of the Fusion.Runntime.dll.

◆ States

enum States
strong

Initialization stages of Fusion

Enumerator
Starting 

Runner is about to start

Running 

Runner is running

Shutdown 

Runner is shutdown

Member Function Documentation

◆ AddCallbacks()

void AddCallbacks ( params INetworkRunnerCallbacks[]  callbacks)

Register an INetworkRunnerCallbacks instance for callbacks from this NetworkRunner.

Parameters
callbacks

◆ AddOrGetGlobal< T >()

T AddOrGetGlobal< T > ( )

Ensures that a specific SimulationBehaviour component exists on this NetworkRunner gameobject.

Type Constraints
T :SimulationBehaviour 

◆ AddPlayerAreaOfInterest()

void AddPlayerAreaOfInterest ( PlayerRef  player,
Vector3  position,
float  extent,
int  layersMask = -1 
)

Adds an area of interest region for a specific player. A player can have multiple areas of interest regions added. These are cleared every tick, so this needs to be called every NetworkBehaviour.FixedUpdateNetwork().

Parameters
playerThe player
positionCenter position of the area of interest
extentThe extents of the area of interest.

◆ AddSimulationBehaviour()

void AddSimulationBehaviour ( SimulationBehaviour  behaviour,
NetworkObject  obj = null 
)

Register a SimulationBehaviour instance with the SimulationBehaviourUpdater. Invalid if NetworkRunner has not been started and initialized.

◆ Attach()

void Attach ( NetworkObject  networkObject,
PlayerRef inputAuthority = null 
)

Attaches a user created network object to the network

Parameters
networkObjectThe object to attach
inputAuthorityIf assigned who is the default input authority for this object

◆ CloudConnectionLostHandler()

delegate void CloudConnectionLostHandler ( NetworkRunner  networkRunner,
ShutdownReason  shutdownReason,
bool  reconnecting 
)

If this callback is implemented, the default behavior of disconnecting when the cloud connection is lost in server/client or host/client mode is disabled. This callback will be invoked instead, leaving the decision up to the user. It is called both on the server/host and on the client.

Parameters
networkRunnerNetworkRunner instance
shutdownReasonShutdown reason for the connection loss
reconnectingFlag to signal if the peer is attempting to reconnect to the Photon Cloud

◆ Despawn()

void Despawn ( NetworkObject  networkObject,
bool  allowPredicted = false 
)

Destroys a NetworkObject.

Parameters
networkObject

◆ Disconnect()

void Disconnect ( PlayerRef  player)

Disconnect a player from the server

Parameters
playerPlayer to disconnect

◆ EnsureRunnerSceneIsActive()

bool EnsureRunnerSceneIsActive ( out Scene  previousActiveScene)

If running in NetworkProjectConfig.PeerModes.Multiple peer mode and the current active scene is different than MultiplePeerUnityScene, switches active scene to MultiplePeerUnityScene, stores the previous active scene in previousActiveScene and returns true. Returns false otherwise.

Parameters
previousActiveScene
Returns
True if an actual change occurred.

◆ Exists() [1/2]

bool Exists ( NetworkId  id)

Returns if the Fusion.Simulation contains a NetworkObject with given id in the current State SimulationSnapshot.

◆ Exists() [2/2]

bool Exists ( NetworkObject  obj)

Returns if the Fusion.Simulation contains a reference to a NetworkObject in the current State SimulationSnapshot.

◆ FindObject()

NetworkObject FindObject ( NetworkId  oref)

Get the NetworkObject instance for this NetworkRunner from a NetworkId.

Parameters
oref
Returns
null if object cannot be found.

◆ GetAllBehaviours()

SimulationBehaviour [] GetAllBehaviours ( Type  type)

Returns array of all SimulationBehaviour registered with this NetworkRunner.

Parameters
type
Returns

◆ GetInputForPlayer< T >()

T? GetInputForPlayer< T > ( PlayerRef  player)

Returns the NetworkInput data from player, converted to the indicated INetworkInput.

Type Constraints
T :unmanaged 
T :INetworkInput 

◆ GetInstancesEnumerator()

static List<NetworkRunner>.Enumerator GetInstancesEnumerator ( )
static

Get enumerator for the collection of all NetworkRunners. Allows to enumerate alloc-free.

Returns

◆ GetInterpolationData()

bool GetInterpolationData ( NetworkBehaviour  behaviour,
bool  predicted,
out InterpolationData  data 
)

Gets the InterpolationData for the current SimulationStages stage. For use in the NetworkBehaviour.Render() callback.

Parameters
behaviour
predictedIndicate if the start and end ticks should represent predicted, or state snapshots.
data
Returns

◆ GetPhysicsScene()

PhysicsScene GetPhysicsScene ( )

Get the 3D Physics scene being used by this Runner.

◆ GetPhysicsScene2D()

PhysicsScene2D GetPhysicsScene2D ( )

Get the 2D Physics scene being used by this Runner.

◆ GetPlayerActorId()

int? GetPlayerActorId ( PlayerRef  player)

Gets Player's Actor Number (ID).

If used in Shared Mode, every client can get this information. If used in Client Server Mode, only the Server is able to get this information.

Parameters
playerPlayerRef to get the Actor Number (ID)
Returns
Actor Number associated with the PlayerRef, otherwise null.

◆ GetPlayerConnectionToken()

byte [] GetPlayerConnectionToken ( PlayerRef  player = default)

Returns a copy of the Connection Token used by a Player when connecting to this Server. Only available on Server. It will return null if running on a Client or the Connection token is missing

Parameters
playerPlayerRef to check for a Connection Token
Returns
Copy of the Connection Token

◆ GetPlayerConnectionType()

ConnectionType GetPlayerConnectionType ( PlayerRef  player)

Return the ConnectionType with a Remote PlayerRef. Valid only when invoked from a Server (NetworkRunner.IsServer)

Parameters
playerRemote Player to check the ConnectionType
Returns
ConnectionType with a PlayerRef

◆ GetPlayerObject()

NetworkObject GetPlayerObject ( PlayerRef  player)

Gets the network object associated with a specific player

Parameters
player
Returns
Network object if one is associated with the player

◆ GetPlayerRtt()

double GetPlayerRtt ( PlayerRef  playerRef)

Returns the player round trip time (ping) in seconds

Parameters
playerRefThe player you want the round trip time for

◆ GetPlayerUserId()

string GetPlayerUserId ( PlayerRef  player = default)

Gets Player's UserID.

If used in Shared Mode, every client can get this information. If used in Client Server Mode, only the Server is able to get this information.

Parameters
playerPlayerRef to get the UserID. If no PlayerRef is passed, the UserID of the local client is returned instead.
Returns
UserID if valid player found, otherwise null.

◆ GetRawInputForPlayer()

NetworkInput? GetRawInputForPlayer ( PlayerRef  player)

Returns the unconverted unsafe NetworkInput for the indicated player.

◆ GetResumeSnapshotNetworkObjects()

IEnumerable<NetworkObject> GetResumeSnapshotNetworkObjects ( )

Iterate over the old NetworkObjects from the Resume Snapshot

Returns
Iterable list of NetworkObject

◆ GetResumeSnapshotNetworkSceneObjects()

IEnumerable<(NetworkObject, NetworkObjectHeaderPtr)> GetResumeSnapshotNetworkSceneObjects ( )

Iterate over the Scene NetworkObjects from the Resume Snapshot while giving the reference of the old Snapshot data associated with that particular Scene Object

Returns
Iterable list of Scene NetworkObject and Scene Object Header

◆ GetRunnerForGameObject()

static NetworkRunner GetRunnerForGameObject ( GameObject  gameObject)
static

Get the NetworkRunner a GameObject instance belongs to.

Parameters
gameObjectGameObject to check for a NetworkRunner
Returns
NetworkRunner reference, or null if not found

◆ GetRunnerForScene()

static NetworkRunner GetRunnerForScene ( Scene  scene)
static

Get the NetworkRunner from a specific Scene

Parameters
sceneScene to check for a NetworkRunner
Returns
NetworkRunner reference, or null if not found

◆ InstantiateInRunnerScene() [1/2]

GameObject InstantiateInRunnerScene ( GameObject  original)

Instantiates an object in the scene of this runner

◆ InstantiateInRunnerScene() [2/2]

GameObject InstantiateInRunnerScene ( GameObject  original,
Vector3  position,
Quaternion  rotation 
)

Instantiates an object in the scene of this runner

◆ InstantiateInRunnerScene< T >() [1/2]

T InstantiateInRunnerScene< T > ( original)

Instantiates an object in the scene of this runner

Type Constraints
T :Component 

◆ InstantiateInRunnerScene< T >() [2/2]

T InstantiateInRunnerScene< T > ( original,
Vector3  position,
Quaternion  rotation 
)

Instantiates an object in the scene of this runner

Type Constraints
T :Component 

◆ InvokeSceneLoadDone()

void InvokeSceneLoadDone ( )

Invoke INetworkRunnerCallbacks.OnSceneLoadDone(NetworkRunner) on all implementations

◆ InvokeSceneLoadStart()

void InvokeSceneLoadStart ( )

Invoke INetworkRunnerCallbacks.OnSceneLoadStart(NetworkRunner) on all implementations

◆ IsPlayerActive()

bool IsPlayerActive ( PlayerRef  player)

Parameters
player
Returns

◆ IsPlayerValid()

bool IsPlayerValid ( PlayerRef  player)

Parameters
player
Returns

◆ JoinSessionLobby()

async Task<StartGameResult> JoinSessionLobby ( SessionLobby  sessionLobby,
string  lobbyID = null,
AuthenticationValues  authentication = null,
AppSettings  customAppSettings = null,
bool?  useDefaultCloudPorts = false,
bool  useCachedRegions = false 
)

Join the Peer to a specific Lobby, either a prebuild or a custom one.

More about matchmaking: https://doc.photonengine.com/fusion/v1/manual/matchmaking

Parameters
sessionLobbyLobby Type to Join
lobbyIDLobby ID
authenticationAuthentication Values used to authenticate this peer
customAppSettingsCustom Photon Application Settings
useDefaultCloudPortsSignal if the LoadBalancingClient should use the Default or Alternative Ports
useCachedRegionsSignal if the cached regions ping should be used to speed up connection
Returns
Async Task to Join a Session Lobby. Can be used to wait for the process to be finished.

◆ MoveToRunnerScene()

void MoveToRunnerScene ( GameObject  go)

Moves an object to the scene of this runner

Parameters
goObject to move

◆ MoveToRunnerScene< T >()

void MoveToRunnerScene< T > ( component)

Moves an object to the scene of this runner

Template Parameters
T
Parameters
componentComponent of object to move
Type Constraints
T :Component 

◆ OnBeforeSpawned()

delegate void OnBeforeSpawned ( NetworkRunner  runner,
NetworkObject  obj 
)

Delegate type for on before spawned callback

◆ PushHostMigrationSnapshot()

Task<bool> PushHostMigrationSnapshot ( )

Compute and send a Host Migration Snapshot to the Photon Cloud

Returns
Task with the result of the operation. True if it was successful, false otherwise.

◆ RemoveCallbacks()

void RemoveCallbacks ( params INetworkRunnerCallbacks[]  callbacks)

Unregister an INetworkRunnerCallbacks instance for callbacks from this NetworkRunner.

Parameters
callbacks

◆ RemoveGlobal< T >()

void RemoveGlobal< T > ( )

Removes a specific SimulationBehaviour from this NetworkRunner gameobject, if it exists.

Type Constraints
T :SimulationBehaviour 

◆ RemoveSimulationBehavior()

void RemoveSimulationBehavior ( SimulationBehaviour  behaviour)

Unregister a SimulationBehaviour instance from the SimulationBehaviourUpdater callbacks. Invalid if NetworkRunner has not been started and initialized.

◆ SendReliableDataToPlayer()

void SendReliableDataToPlayer ( PlayerRef  player,
byte[]  data 
)

Send an arbitrary data buffer to a target Player

Parameters
playerPlayer that should receive the buffer
dataBuffer to be sent

◆ SendReliableDataToServer()

void SendReliableDataToServer ( byte[]  data)

Send an arbitrary data buffer to the Server

Parameters
dataBuffer to be sent

◆ SendRpc() [1/2]

void SendRpc ( SimulationMessage *  message)

Sends RPC message. Not meant to be used directly, ILWeaver calls this.

Parameters
message

◆ SendRpc() [2/2]

void SendRpc ( SimulationMessage *  message,
out RpcSendResult  info 
)

Sends RPC message. Not meant to be used directly, ILWeaver calls this.

Parameters
message
info

◆ SetActiveScene()

void SetActiveScene ( SceneRef  scene)

Update the current Active Scene

Parameters
sceneSceneRef to be activated

◆ SetInterestGroup()

void SetInterestGroup ( NetworkObject  obj,
PlayerRef  player,
string  group,
bool  interested 
)

Add or remove Player's interest in a specific named Interest Group for a specific NetworkObject.
SimulationConfig.ReplicationMode must be set to SimulationConfig.StateReplicationModes.EventualConsistency.

◆ SetPlayerAlwaysInterested()

void SetPlayerAlwaysInterested ( PlayerRef  player,
NetworkObject  networkObject,
bool  alwaysInterested 
)

Flags this player as always interested in this object. Means it does not have to be in a players area of interest to be replicated.

Parameters
playerThe player
networkObjectThe object
alwaysInterestedIf he's always interested, or not.

◆ SetPlayerObject()

void SetPlayerObject ( PlayerRef  player,
NetworkObject  networkObject 
)

Sets the network object associated with this player

Parameters
player
networkObject

◆ SetSimulationState()

bool SetSimulationState ( NetworkObject  obj,
bool  simulate 
)

Sets the simulation state for this object, if it takes part in the NetworkFixedUpdate, etc.

Parameters
objthe object to change state for
simulatetrue if it should be simulated, false if otherwise
Returns
true if the state of the object changed, false otherwise

◆ Shutdown()

Task Shutdown ( bool  destroyGameObject = true,
ShutdownReason  shutdownReason = ShutdownReason.Ok,
bool  forceShutdownProcedure = false 
)

Initiates a Simulation.Dispose.

◆ SinglePlayerContinue()

void SinglePlayerContinue ( )

Continues a paused game in single player

◆ SinglePlayerPause() [1/2]

void SinglePlayerPause ( )

Pauses the game in single player

◆ SinglePlayerPause() [2/2]

void SinglePlayerPause ( bool  paused)

Sets the paused state in a single player

◆ Spawn() [1/6]

NetworkObject Spawn ( GameObject  prefab,
Vector3?  position = null,
Quaternion?  rotation = null,
PlayerRef inputAuthority = null,
OnBeforeSpawned  onBeforeSpawned = null,
NetworkObjectPredictionKey?  predictionKey = null,
bool  syncPhysics = true 
)

Attempts to network instantiate a NetworkObject using a GameObject. The supplied GameObject must have a NetworkObject component.

Parameters
prefabA GameObject with a NetworkObject
positionSpawn Position
rotationSpawn Rotation
inputAuthorityPlayer Input Authority
onBeforeSpawnedOnBeforeSpawned reference
predictionKeyNetworkObjectPredictionKey reference
syncPhysicsIf Physics.SyncTransforms and Physics2D.SyncTransforms should be called after setting the network object position and/or rotation , if provided.
Returns
NetworkObject reference, or null if it was not able to spawn the object

◆ Spawn() [2/6]

NetworkObject Spawn ( NetworkObject  prefab,
Vector3?  position = null,
Quaternion?  rotation = null,
PlayerRef inputAuthority = null,
OnBeforeSpawned  onBeforeSpawned = null,
NetworkObjectPredictionKey?  predictionKey = null,
bool  syncPhysics = true 
)

Attempts to network instantiate a NetworkObject using a NetworkObject prefab. Note: position and rotation values are only used locally for the instantiation of the object, and are not inherently networked. Use NetworkPositionRotation, or any of its derived classes such as NetworkTransform to replicate the initial transform state.

Parameters
prefabPrefab used to spawn the NetworkObject
positionSpawn Position
rotationSpawn Rotation
inputAuthorityPlayer Input Authority
onBeforeSpawnedOnBeforeSpawned reference
predictionKeyNetworkObjectPredictionKey reference
syncPhysicsIf Physics.SyncTransforms and Physics2D.SyncTransforms should be called after setting the network object position and/or rotation , if provided.
Returns
NetworkObject reference, or null if it was not able to spawn the object

◆ Spawn() [3/6]

NetworkObject Spawn ( NetworkObjectGuid  prefabGuid,
Vector3?  position = null,
Quaternion?  rotation = null,
PlayerRef inputAuthority = null,
OnBeforeSpawned  onBeforeSpawned = null,
NetworkObjectPredictionKey?  predictionKey = null,
bool  syncPhysics = true 
)

Attempts to network instantiate a NetworkObject using a NetworkObjectGuid Note: position and rotation values are only used locally for the instantiation of the object, and are not inherently networked. Use NetworkPositionRotation, or any of its derived classes such as NetworkTransform to replicate the initial transform state.

Parameters
prefabGuidObject Guid used to spawn the NetworkObject
positionSpawn Position
rotationSpawn Rotation
inputAuthorityPlayer Input Authority
onBeforeSpawnedOnBeforeSpawned reference
predictionKeyNetworkObjectPredictionKey reference
syncPhysicsIf Physics.SyncTransforms and Physics2D.SyncTransforms should be called after setting the network object position and/or rotation , if provided.
Returns
NetworkObject reference, or null if it was not able to spawn the object

◆ Spawn() [4/6]

NetworkObject Spawn ( NetworkPrefabAsset  prefabAsset,
Vector3?  position = null,
Quaternion?  rotation = null,
PlayerRef inputAuthority = null,
OnBeforeSpawned  onBeforeSpawned = null,
NetworkObjectPredictionKey?  predictionKey = null 
)

Attempts to network instantiate a NetworkObject using a NetworkPrefabAsset Note: position and rotation values are only used locally for the instantiation of the object, and are not inherently networked. Use NetworkPositionRotation, or any of its derived classes such as NetworkTransform to replicate the initial transform state.

Parameters
prefabAssetPrefab Asset used to spawn the NetworkObject
positionSpawn Position
rotationSpawn Rotation
inputAuthorityPlayer Input Authority
onBeforeSpawnedOnBeforeSpawned reference
predictionKeyNetworkObjectPredictionKey reference
Returns
NetworkObject reference, or null if it was not able to spawn the object

◆ Spawn() [5/6]

NetworkObject Spawn ( NetworkPrefabId  prefabId,
Vector3?  position = null,
Quaternion?  rotation = null,
PlayerRef inputAuthority = null,
OnBeforeSpawned  onBeforeSpawned = null,
NetworkObjectPredictionKey?  predictionKey = null,
bool  syncPhysics = true,
NetworkObject  resumeNO = null 
)

Attempts to network instantiate a NetworkObject using a NetworkPrefabId Note: position and rotation values are only used locally for the instantiation of the object, and are not inherently networked. Use NetworkPositionRotation, or any of its derived classes such as NetworkTransform to replicate the initial transform state.

Parameters
prefabIdPrefab ID used to spawn the NetworkObject
positionSpawn Position
rotationSpawn Rotation
inputAuthorityPlayer Input Authority
onBeforeSpawnedOnBeforeSpawned reference
predictionKeyNetworkObjectPredictionKey reference
syncPhysicsIf Physics.SyncTransforms and Physics2D.SyncTransforms should be called after setting the network object position and/or rotation , if provided.
resumeNOUsed as reference when re-creating the NetworkObject from a old simulation. Accepted only when resuming from a Host Migration.
Returns
NetworkObject reference, or null if it was not able to spawn the object

◆ Spawn() [6/6]

NetworkObject Spawn ( NetworkPrefabRef  prefabRef,
Vector3?  position = null,
Quaternion?  rotation = null,
PlayerRef inputAuthority = null,
OnBeforeSpawned  onBeforeSpawned = null,
NetworkObjectPredictionKey?  predictionKey = null 
)

Attempts to network instantiate a NetworkObject using a NetworkPrefabRef. Note: position and rotation values are only used locally for the instantiation of the object, and are not inherently networked. Use NetworkPositionRotation, or any of its derived classes such as NetworkTransform to replicate the initial transform state.

Parameters
prefabRefPrefab Ref used to spawn the NetworkObject
positionSpawn Position
rotationSpawn Rotation
inputAuthorityPlayer Input Authority
onBeforeSpawnedOnBeforeSpawned reference
predictionKeyNetworkObjectPredictionKey reference
Returns
NetworkObject reference, or null if it was not able to spawn the object

◆ Spawn< T >()

T Spawn< T > ( prefab,
Vector3?  position = null,
Quaternion?  rotation = null,
PlayerRef inputAuthority = null,
OnBeforeSpawned  onBeforeSpawned = null,
NetworkObjectPredictionKey?  predictionKey = null,
bool  syncPhysics = true 
)

Attempts to network instantiate a NetworkObject using a Component type that is part of a NetworkObject

Template Parameters
TMust be a Type derived from SimulationBehaviour
Parameters
prefabSimulationBehaviour used to spawn the NetworkObject
positionSpawn Position
rotationSpawn Rotation
inputAuthorityPlayer Input Authority
onBeforeSpawnedOnBeforeSpawned reference
predictionKeyNetworkObjectPredictionKey reference
syncPhysicsIf Physics.SyncTransforms and Physics2D.SyncTransforms should be called after setting the network object position and/or rotation , if provided.
Returns
NetworkObject reference, or null if it was not able to spawn the object
Type Constraints
T :SimulationBehaviour 

◆ StartGame()

Task<StartGameResult> StartGame ( StartGameArgs  args)

Starts the local Fusion Runner and takes care of all major setup necessary

More about matchmaking: https://doc.photonengine.com/fusion/v1/manual/matchmaking

Parameters
argsCustom arguments used to setup the Fusion Simulation
Returns
Task that can be awaited to chain actions

◆ TryFindBehaviour()

bool TryFindBehaviour ( NetworkBehaviourId  bref,
out NetworkBehaviour  behaviour 
)

Get the NetworkBehaviour instance for this NetworkRunner from a NetworkBehaviourId.

Parameters
bref
behaviour
Returns
True if object was found.

◆ TryFindObject()

bool TryFindObject ( NetworkId  oref,
out NetworkObject  obj 
)

Get the NetworkObject instance for this NetworkRunner from a NetworkId.

Parameters
oref
obj
Returns
True if object was found.

◆ TryGetInputForPlayer< T >()

bool TryGetInputForPlayer< T > ( PlayerRef  player,
out T  input 
)

Outputs the NetworkInput from player, translated to the indicated INetworkInput.

Type Constraints
T :unmanaged 
T :INetworkInput 

◆ TryGetNetworkedBehaviourFromNetworkedObjectRef< T >()

T TryGetNetworkedBehaviourFromNetworkedObjectRef< T > ( NetworkId  id)

Tries to return the first instance of T found on the root of a NetworkObject.

Template Parameters
T
Parameters
id
Returns
Returns the found component. Null if the NetworkObject cannot be found, or if T cannot be found on the GameObject.
Type Constraints
T :NetworkBehaviour 

◆ TryMultiplePeerAssignTempScene()

bool TryMultiplePeerAssignTempScene ( )

Try to create a temp empty scene for PhysicsScene

Returns
false if the runner was on the temp scene already, true otherwise.

Property Documentation

◆ ActivePlayers

IEnumerable<PlayerRef> ActivePlayers
get

Returns the collection of PlayerRef objects for this NetworkRunner's Fusion.Simulation.

◆ AuthenticationValues

AuthenticationValues AuthenticationValues
get

AuthenticationValues used by this Runner to Authenticate the local peer.

◆ BuildType

BuildTypes BuildType
staticget

Get Fusion.Runtime.dll build type.

◆ Config

Returns the NetworkProjectConfig reference.

◆ CurrentConnectionType

ConnectionType CurrentConnectionType
get

Check the current Connection Type with the Remote Server

◆ CurrentScene

SceneRef CurrentScene
get

Returns the current loaded network scene.

◆ DeltaTime

float DeltaTime
get

Returns the fixed tick time interval. Derived from the SimulationConfig.TickRate.

◆ GameMode

Current Game Mode active on the Fusion Simulation

◆ Instances

IReadOnlyList<NetworkRunner> Instances
staticget

A list of all NetworkRunners.

◆ InterpolationRenderTime

float InterpolationRenderTime
get

The current time (current State.Time + Simulation.DeltaTime) for non-predicted objects (objects in a remote time frame). Use as an equivalent to Unity's Time.time. Time is relative to Tick 0 (which represents Time 0f).

◆ IsClient

bool IsClient
get

Returns if this Fusion.Simulation represents a Client connection.

◆ IsConnectedToServer

bool IsConnectedToServer
get

Returns if this Client is currently connected to a Remote Server

◆ IsFirstTick

bool IsFirstTick
get

If this is the first tick that executes this update or re-simulation

◆ IsForward

bool IsForward
get

If this is not a re-simulation but a new forward tick

◆ IsHostMigrationEnabled

bool IsHostMigrationEnabled
get

Signal if Fusion was initilized with Host Migration system enabled

◆ IsLastTick

bool IsLastTick
get

If this is the last tick that is being executed this update

◆ IsMultiplePeerSceneTemp

bool IsMultiplePeerSceneTemp
get

Signal if this Runner is already in a Temp Physics Scene

◆ IsPlayer

bool IsPlayer
get

Returns true if this runner represents a Client or Host. Dedicated servers have no local player and will return false.

◆ IsResimulation

bool IsResimulation
get

If we are currently executing a client side prediction re-simulation.

◆ IsResume

bool IsResume
get

if this instance is a resume (host migration)

◆ IsRunning

bool IsRunning
get

Returns if this Fusion.Simulation is valid and running.

◆ IsServer

bool IsServer
get

Returns if this Fusion.Simulation represents a Server connection.

◆ IsSharedModeMasterClient

bool IsSharedModeMasterClient
get

Signal if the Local Peer is in a Room and is the Room Master Client

◆ IsShutdown

bool IsShutdown
get

If the runner is shutdown

◆ IsSinglePlayer

bool IsSinglePlayer
get

Returns true if this runner was started as single player (Started as SimulationModes.Host with SimulationConfig.DefaultPlayers = 1).

◆ IsStarting

bool IsStarting
get

If the runner is pending to start

◆ IsVisible

bool IsVisible
getset

Change the visibility of this NetworkRunner when running in Multiple Peer Mode

◆ LagCompensation

HitboxManager LagCompensation
get

Returns the global instance of a lag compensation buffer Fusion.HitboxManager.

◆ LobbyInfo

Signal if the local peer is already inside a Lobby

◆ LocalPlayer

PlayerRef LocalPlayer
get

Returns a PlayerRef for the local simulation. For a dedicated server PlayerRef.IsValid will equal false. PlayerRefs are assigned in order from 0 to MaxPlayers-1 and are re-used as players join and leave. The only caveat is that the server player (if one exists), always gets the last index no matter how many clients are connected.

◆ Mode

SimulationModes Mode
get

Returns the SimulationModes flags for The type of network peer the associated Fusion.Simulation represents.

◆ MultiplePeerUnityScene

Scene MultiplePeerUnityScene
getset

A scene used when run in NetworkProjectConfig.PeerModes.Multiple mode.

◆ NATType

Exposes the current NAT Type from the local Peer

◆ ObjectPool

INetworkObjectPool ObjectPool
get

Returns the INetworkObjectPool instance.

◆ ProvideInput

bool ProvideInput
getset

Indicates if this NetworkRunner is collecting PlayerRef INetworkInput.

◆ SceneManager

INetworkSceneManager SceneManager
get

Returns the INetworkSceneManager instance.

◆ SessionInfo

Stores information about the current running session

◆ Simulation

Returns the Fusion.Simulation for this NetworkRunner.

◆ SimulationRenderTime

float SimulationRenderTime
get

The current time (current State.Time + Simulation.DeltaTime) for predicted objects (objects in the local time frame). Use as an equivalent to Unity's Time.time. Time is relative to Tick 0 (which represents Time 0f).

◆ SimulationTime

float SimulationTime
get

The time the current State SimulationSnapshot represents (the most recent FixedUpdateNetwork simulation). Use as an equivalent to Unity's Time.fixedTime. Time is relative to Tick 0 (which represents Time 0f).

◆ SimulationUnityScene

Scene SimulationUnityScene
get

Returns the Unity scene for this NetworkRunner. With NetworkProjectConfig.PeerModes.Multiple, multiple physics scenes may exist, and this getter should be used in place of SceneManager.GetActiveScene().

◆ Stage

SimulationStages Stage
get

Returns the current SimulationStages stage of this Fusion.Simulation.

◆ State

States State
get

The current state of the runner, if it's Starting, Running, Shutdown

◆ Tick

Tick??? Tick
get

The tick associated with the current state of networked objects, or the current simulation tick being processed (when evaluated during FixedUpdateNetwork).

◆ TicksExecuted

int TicksExecuted
get

Returns how many ticks we executed last update.

◆ Topology

The current topology used

◆ UserId

string UserId
get

Returns null if Peer is not connected to Photon Cloud