|
void | AddCallbacks (params INetworkRunnerCallbacks[] callbacks) |
| Register an INetworkRunnerCallbacks instance for callbacks from this NetworkRunner.
|
|
void | AddGlobal< T > () |
|
T | AddOrGetGlobal< T > () |
| Ensures that a specific SimulationBehaviour component exists on this NetworkRunner gameobject.
|
|
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().
|
|
void | AddSimulationBehaviour (SimulationBehaviour behaviour, NetworkObject obj=null) |
| Register a SimulationBehaviour instance with the SimulationBehaviourUpdater. Invalid if NetworkRunner has not been started and initialized.
|
|
void | Attach (NetworkObject networkObject, PlayerRef? inputAuthority=null) |
| Attaches a user created network object to the network.
|
|
void | Despawn (NetworkObject networkObject, bool allowPredicted=false) |
| Destroys a NetworkObject.
|
|
void | Disconnect (PlayerRef player) |
| Disconnect a player from the server.
|
|
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.
|
|
bool | Exists (NetworkId id) |
| Returns if the Fusion.Simulation contains a NetworkObject with given id in the current State SimulationSnapshot.
|
|
bool | Exists (NetworkObject obj) |
| Returns if the Fusion.Simulation contains a reference to a NetworkObject in the current State SimulationSnapshot.
|
|
NetworkObject | FindObject (NetworkId oref) |
| Get the NetworkObject instance for this NetworkRunner from a NetworkId.
|
|
SimulationBehaviour[] | GetAllBehaviours (Type type) |
| Returns array of all SimulationBehaviour registered with this NetworkRunner.
|
|
List< T > | GetAllBehaviours< T > () |
|
void | GetAllBehaviours< T > (List< T > result) |
|
T | GetGlobal< T > () |
|
int | GetHashCodeForLogger () |
|
T? | GetInputForPlayer< T > (PlayerRef player) |
| Returns the NetworkInput data from player, converted to the indicated INetworkInput.
|
|
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.
|
|
PhysicsScene | GetPhysicsScene () |
| Get the 3D Physics scene being used by this Runner.
|
|
PhysicsScene2D | GetPhysicsScene2D () |
| Get the 2D Physics scene being used by this Runner.
|
|
int? | GetPlayerActorId (PlayerRef player) |
| Gets Player's Actor Number (ID).
|
|
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.
|
|
ConnectionType | GetPlayerConnectionType (PlayerRef player) |
| Return the ConnectionType with a Remote PlayerRef. Valid only when invoked from a Server (NetworkRunner.IsServer)
|
|
NetworkObject | GetPlayerObject (PlayerRef player) |
| Gets the network object associated with a specific player.
|
|
double | GetPlayerRtt (PlayerRef playerRef) |
| Returns the player round trip time (ping) in seconds.
|
|
string | GetPlayerUserId (PlayerRef player=default) |
| Gets Player's UserID.
|
|
NetworkInput? | GetRawInputForPlayer (PlayerRef player) |
| Returns the unconverted unsafe NetworkInput for the indicated player.
|
|
IEnumerable< NetworkObject > | GetResumeSnapshotNetworkObjects () |
| Iterate over the old NetworkObjects from the Resume Snapshot.
|
|
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.
|
|
RpcTargetStatus | GetRpcTargetStatus (PlayerRef target) |
|
bool | HasAnyActiveConnections () |
|
GameObject | InstantiateInRunnerScene (GameObject original) |
| Instantiates an object in the scene of this runner.
|
|
GameObject | InstantiateInRunnerScene (GameObject original, Vector3 position, Quaternion rotation) |
| Instantiates an object in the scene of this runner.
|
|
T | InstantiateInRunnerScene< T > (T original) |
| Instantiates an object in the scene of this runner.
|
|
T | InstantiateInRunnerScene< T > (T original, Vector3 position, Quaternion rotation) |
| Instantiates an object in the scene of this runner.
|
|
void | InvokeSceneLoadDone () |
| Invoke INetworkRunnerCallbacks.OnSceneLoadDone(NetworkRunner) on all implementations.
|
|
void | InvokeSceneLoadStart () |
| Invoke INetworkRunnerCallbacks.OnSceneLoadStart(NetworkRunner) on all implementations.
|
|
bool | IsPlayerActive (PlayerRef player) |
|
bool | IsPlayerValid (PlayerRef player) |
|
async Task< StartGameResult > | JoinSessionLobby (SessionLobby sessionLobby, string lobbyID=null, AuthenticationValues authentication=null, AppSettings customAppSettings=null, bool? useDefaultCloudPorts=false) |
| Join the Peer to a specific Lobby, either a prebuild or a custom one.
|
|
void | MoveToRunnerScene (GameObject go) |
| Moves an object to the scene of this runner.
|
|
void | MoveToRunnerScene< T > (T component) |
| Moves an object to the scene of this runner.
|
|
delegate void | OnBeforeSpawned (NetworkRunner runner, NetworkObject obj) |
| Delegate type for on before spawned callback.
|
|
Task< bool > | PushHostMigrationSnapshot () |
| Compute and send a Host Migration Snapshot to the Photon Cloud.
|
|
void | RegisterSceneObjects (IEnumerable< NetworkObject > objects) |
|
void | RegisterUniqueObjects (IEnumerable< NetworkObject > objects) |
|
void | RemoveCallbacks (params INetworkRunnerCallbacks[] callbacks) |
| Unregister an INetworkRunnerCallbacks instance for callbacks from this NetworkRunner.
|
|
void | RemoveGlobal< T > () |
| Removes a specific SimulationBehaviour from this NetworkRunner gameobject, if it exists.
|
|
void | RemoveSimulationBehavior (SimulationBehaviour behaviour) |
| Unregister a SimulationBehaviour instance from the SimulationBehaviourUpdater callbacks. Invalid if NetworkRunner has not been started and initialized.
|
|
void | SendReliableDataToPlayer (PlayerRef player, byte[] data) |
| Send an arbitrary data buffer to a target Player.
|
|
void | SendReliableDataToServer (byte[] data) |
| Send an arbitrary data buffer to the Server.
|
|
void | SendRpc (SimulationMessage *message) |
| Sends RPC message. Not meant to be used directly, ILWeaver calls this.
|
|
void | SendRpc (SimulationMessage *message, out RpcSendResult info) |
| Sends RPC message. Not meant to be used directly, ILWeaver calls this.
|
|
void | SetActiveScene (SceneRef scene) |
| Update the current Active Scene.
|
|
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.
|
|
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.
|
|
void | SetPlayerObject (PlayerRef player, NetworkObject networkObject) |
| Sets the network object associated with this player.
|
|
bool | SetSimulationState (NetworkObject obj, bool simulate) |
| Sets the simulation state for this object, if it takes part in the NetworkFixedUpdate, etc.
|
|
Task | Shutdown (bool destroyGameObject=true, ShutdownReason shutdownReason=ShutdownReason.Ok, bool forceShutdownProcedure=false) |
| Initiates a Simulation.Dispose.
|
|
void | SinglePlayerContinue () |
| Continues a paused game in single player.
|
|
void | SinglePlayerPause () |
| Pauses the game in single player.
|
|
void | SinglePlayerPause (bool paused) |
| Sets the paused state in a single player.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
T | 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
|
|
Task< StartGameResult > | StartGame (StartGameArgs args) |
| Starts the local Fusion Runner and takes care of all major setup necessary.
|
|
bool | TryFindBehaviour (NetworkBehaviourId bref, out NetworkBehaviour behaviour) |
| Get the NetworkBehaviour instance for this NetworkRunner from a NetworkBehaviourId.
|
|
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.
|
|
bool | TryGetInputForPlayer< T > (PlayerRef player, out T input) |
| Outputs the NetworkInput from player, translated to the indicated INetworkInput.
|
|
T | TryGetNetworkedBehaviourFromNetworkedObjectRef< T > (NetworkId id) |
| Tries to return the first instance of T found on the root of a NetworkObject.
|
|
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.
|
|
T | AddBehaviour< T > () |
| Wrapper for Unity's GameObject.AddComponent()
|
|
T | GetBehaviour< T > () |
| Wrapper for Unity's GameObject.GetComponentInChildren()
|
|
bool | TryGetBehaviour< T > (out T behaviour) |
| Wrapper for Unity's GameObject.TryGetComponent()
|
|
|
IEnumerable< PlayerRef > | ActivePlayers [get] |
| Returns the collection of PlayerRef objects for this NetworkRunner's Fusion.Simulation.
|
|
AuthenticationValues | AuthenticationValues [get] |
| AuthenticationValues used by this Runner to Authenticate the local peer.
|
|
static BuildTypes | BuildType [get] |
| Get Fusion.Runtime.dll build type.
|
|
NetworkProjectConfig | Config [get] |
| Returns the NetworkProjectConfig reference.
|
|
ConnectionType | CurrentConnectionType [get] |
| Check the current Connection Type with the Remote Server.
|
|
SceneRef | CurrentScene [get] |
| Returns the current loaded network scene.
|
|
float | DeltaTime [get] |
| Returns the fixed tick time interval. Derived from the SimulationConfig.TickRate.
|
|
GameMode | GameMode [get] |
| Current Game Mode active on the Fusion Simulation.
|
|
static IReadOnlyList< NetworkRunner > | Instances [get] |
| A list of all NetworkRunners.
|
|
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).
|
|
bool | IsClient [get] |
| Returns if this Fusion.Simulation represents a Client connection.
|
|
bool | IsCloudReady [get] |
| Signal if the Local Peer is connected to Photon Cloud and is able to Create/Join Room but also receive Lobby Updates.
|
|
bool | IsConnectedToServer [get] |
| Returns if this Client is currently connected to a Remote Server.
|
|
bool | IsFirstTick [get] |
| If this is the first tick that executes this update or re-simulation.
|
|
bool | IsForward [get] |
| If this is not a re-simulation but a new forward tick.
|
|
bool | IsHostMigrationEnabled [get] |
| Signal if Fusion was initilized with Host Migration system enabled.
|
|
bool | IsLastTick [get] |
| If this is the last tick that is being executed this update.
|
|
bool | IsMultiplePeerSceneTemp [get] |
| Signal if this Runner is already in a Temp Physics Scene.
|
|
bool | IsPlayer [get] |
| Returns true if this runner represents a Client or Host. Dedicated servers have no local player and will return false.
|
|
bool | IsResimulation [get] |
| If we are currently executing a client side prediction re-simulation.
|
|
bool | IsResume [get] |
| if this instance is a resume (host migration)
|
|
bool | IsRunning [get] |
| Returns if this Fusion.Simulation is valid and running.
|
|
bool | IsServer [get] |
| Returns if this Fusion.Simulation represents a Server connection.
|
|
bool | IsSharedModeMasterClient [get] |
| Signal if the Local Peer is in a Room and is the Room Master Client.
|
|
bool | IsShutdown [get] |
| If the runner is shutdown.
|
|
bool | IsSinglePlayer [get] |
| Returns true if this runner was started as single player (Started as SimulationModes.Host with SimulationConfig.DefaultPlayers = 1).
|
|
bool | IsStarting [get] |
| If the runner is pending to start.
|
|
bool | IsVisible [get, set] |
| Change the visibility of this NetworkRunner when running in Multiple Peer Mode.
|
|
HitboxManager | LagCompensation [get] |
| Returns the global instance of a lag compensation buffer Fusion.HitboxManager.
|
|
LobbyInfo | LobbyInfo = new LobbyInfo() [get] |
| Signal if the local peer is already inside a Lobby.
|
|
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.
|
|
SimulationModes | Mode [get] |
| Returns the SimulationModes flags for The type of network peer the associated Fusion.Simulation represents.
|
|
Scene | MultiplePeerUnityScene [get, set] |
| A scene used when run in NetworkProjectConfig.PeerModes.Multiple mode.
|
|
NATType | NATType [get] |
| Exposes the current NAT Type from the local Peer.
|
|
INetworkObjectPool | ObjectPool [get] |
| Returns the INetworkObjectPool instance.
|
|
bool | ProvideInput [get, set] |
| Indicates if this NetworkRunner is collecting PlayerRef INetworkInput.
|
|
INetworkSceneManager | SceneManager [get] |
| Returns the INetworkSceneManager instance.
|
|
SessionInfo | SessionInfo = new SessionInfo() [get] |
| Stores information about the current running session.
|
|
Simulation | Simulation [get] |
| Returns the Fusion.Simulation for this NetworkRunner.
|
|
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).
|
|
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).
|
|
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().
|
|
SimulationStages | Stage [get] |
| Returns the current SimulationStages stage of this Fusion.Simulation.
|
|
States | State [get] |
| The current state of the runner, if it's Starting, Running, Shutdown.
|
|
Tick | Tick [get] |
| The tick associated with the current state of networked objects, or the current simulation tick being processed (when evaluated during FixedUpdateNetwork).
|
|
int | TicksExecuted [get] |
| Returns how many ticks we executed last update.
|
|
SimulationConfig.Topologies | Topology [get] |
| The current topology used.
|
|
string | UserId [get] |
| Photon Client UserID.
|
|