|
|
void | AssignInputAuthority (PlayerRef player) |
| | Sets which PlayerRef has Input Authority for this Object.
|
| bool | ClearPriority (PlayerRef player) |
| | Clears a send priority previously set with SetPriority for player , restoring the default, calling this function is equivalent to calling.
|
| void | CopyStateFrom (NetworkObject source) |
| | Copies the entire State from another NetworkObject.
|
| void | CopyStateFrom (NetworkObjectHeaderPtr source) |
| | Copies the entire State from another NetworkObject based on the NetworkObjectHeaderPtr.
|
|
int | GetLocalAuthorityMask () |
| | Gets a bitmask of AuthorityMasks flags, representing the current local authority over this NetworkObject.
|
| delegate int | PriorityLevelDelegate (NetworkObject networkObject, PlayerRef player) |
| | Delegate for determining the priority level of a network object for a specific player.
|
|
bool | ReleaseStateAuthority () |
| | Release the state authority over this NetworkObject on shared mode.
|
|
void | RemoveInputAuthority () |
| | Removes input authority from whichever player has it for this object. Only valid when called on a Host or Server peer.
|
| delegate bool | ReplicateToDelegate (NetworkObject networkObject, PlayerRef player) |
| | Delegate for determining if a network object should be replicated to a specific player.
|
|
bool | RequestStateAuthority () |
| | Request state authority over this NetworkObject on shared mode.
|
| bool | ResetToLatestState () |
| | Reset the current network state to the latest server snapshot read. It has no effect if the local simulation has state authority or is executing resimulation tick.
|
| bool | SetPlayerAlwaysInterested (PlayerRef player, bool alwaysInterested) |
| | Add or remove specific player interest in this NetworkObject. Only the NetworkObject State Authority can set interest.
|
| bool | SetPriority (PlayerRef player, int priority) |
| | Sets the send priority of this object for player . Client/Server: must be called on the Server (Host or Dedicated); as it adjusts the rate at which the server sends data to the player . Shared Mode: player must be the Simulation.LocalPlayer the request is forwarded to the plugin, which adjusts the send rate for this NetworkObject back to the player .
|
|
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().
|
|
|
bool | EnableInterpolation = true |
| | Should the NetworkObject interpolate the network state? Disable it for performance improvement on objects that do not require interpolation, snapping it to the latest data. Changing this field after the object is spawned will have no effect.
|
|
NetworkObjectFlags | Flags = NetworkObjectFlags.DestroyWhenStateAuthorityLeaves |
| | Flags used for network object prefabs and similar.
|
|
bool | ForceRemoteRenderTimeframe = false |
| | Force the RenderTimeframe used to RenderTimeframe.Remote.
|
|
bool | IsResume |
| | Signal that this NetworkObject comes from a Resume Spawn.
|
|
NetworkObject[] | NestedObjects |
| | Array of initial child nested NetworkObject entities, that are children of this Object.
|
|
NetworkBehaviour[] | NetworkedBehaviours |
| | Array of all NetworkBehaviours associated with this network entity.
|
|
NetworkObjectTypeId | NetworkTypeId |
| | The type ID for this prefab or scene object, set when adding to the prefab table and registering scene objects, respectively. All spawned instances of this object will retain this value. Use NetworkId for the unique ID of network entries.
|
|
int | SendPriority = 1 |
| | Obsolete. Use NetworkObject.SetPriority / NetworkObject.ClearPriority instead.
|
|
PriorityLevelDelegate | SendPriorityCallback |
| | Obsolete. Use NetworkObject.SetPriority / NetworkObject.ClearPriority instead.
|
|
uint | SortKey |
| | Used for whenever objects need to be sorted in a deterministic order, like when registering scene objects.
|
|
|
bool | HasInputAuthority [get] |
| | Returns if Simulation.LocalPlayer is the designated Input Source for this network entity.
|
|
bool | HasStateAuthority [get] |
| | Returns if Simulation.LocalPlayer is the designated State Source for this network entity.
|
|
NetworkId | Id [get] |
| | The unique identifier for this network entity.
|
|
PlayerRef | InputAuthority [get] |
| | Returns the PlayerRef that has Input Authority over this network entity. 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.
|
|
bool | IsInSimulation [get] |
| | Is this object simulated? I.e. whether NetworkBehaviour.FixedUpdateNetwork, etc. are called. Also see: NetworkRunner.SetIsSimulated.
|
|
bool | IsNested [get] |
| | Returns true if this object is nested in a prefab instance.
|
|
bool | IsProxy [get] |
| | Returns if Simulation.LocalPlayer is neither the Input nor State Source for this network entity.
|
|
bool | IsRenderInterpolationReady [get] |
| | Returns true when this object's interpolated state is usable. Intended for the remote-spawn hide/show pattern: hide in NetworkBehaviour.Spawned when this is false, show in SimulationBehaviour.Render once it becomes true, to avoid a brief visible stall. Always true on the state authority, hiding and showing isn't required here as state authority spawned objects aren't interpolated Note: Do not hide by calling gameObject.SetActive(false) on this NetworkObject's own GameObject (or any parent of it) in NetworkBehaviour.Spawned. Disabled GameObjects do not receive SimulationBehaviour.Render callbacks, so the show branch would never run and the object would stay hidden forever. Instead you could toggle a child GameObject or disable individual Renderers.
|
|
bool | IsSpawnable [get, set] |
| | Toggles if this NetworkObject is included in the NetworkProjectConfig.PrefabTable, which will include the prefab in builds as a Spawnable object.
|
|
bool | IsValid [get] |
| | Returns true while a NetworkObject is valid (after it is spawned until it is despawned). While this property is true, Networked Properties and RPCs on the NetworkObject can be used. Internally, the property validates whether a NetworkObject is associated with its NetworkRunner, and that runner is not null.
|
|
Tick | LastReceiveTick [get] |
| | Last tick this object received an update.
|
|
string | Name [get] |
| | The ID + Unity GameObject name for this entity.
|
|
NetworkObject | NestingRoot [get] |
| | Returns root of this prefab instance, if this object is nested.
|
|
NetworkObjectInterestModes | ObjectInterest [get, set] |
| | How Object Interest is determined for this object.
|
|
RenderSource | RenderSource [get, set] |
| | Returns the Fusion.RenderSource for this Fusion.NetworkBehaviour instance, indicating how snapshot data will be used to render it.
|
|
float | RenderTime [get] |
| | Returns the current interpolation time for this object.
|
|
RenderTimeframe | RenderTimeframe [get] |
| | Returns the Fusion.RenderTimeframe for this Fusion.NetworkBehaviour instance, indicating what snapshot data will be used to render it.
|
|
NetworkRunner | Runner [get] |
| | The NetworkRunner this entity is associated with.
|
|
PlayerRef | StateAuthority [get] |
| | Returns the PlayerRef that has State Authority over this network entity. 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.
|
The primary Fusion component for networked GameObject entities. This stores the object's network identity and manages the object's state and input authority.
Clears a send priority previously set with SetPriority for player , restoring the default, calling this function is equivalent to calling.
bool SetPriority(PlayerRef player, int priority)
Sets the send priority of this object for player . Client/Server: must be called on the Server (Host ...
Definition NetworkObject.cs:414
Client/Server: must be called on the Server (Host or Dedicated); as it adjusts the rate at which the server sends data to the player .
Shared Mode: player must be the Simulation.LocalPlayer the request is forwarded to the plugin, which adjusts the send rate for this NetworkObject back to the player
HostMigration: Priority is not replicated state and as such is not automatically carried over during a HostMigration, if your applicatiton supports host migratiton IAfterHostMigration can be used to re-apply priorities on the new host.
- Returns
true If called from an effective context e.g calling this from a Client in Client/Server will return false, calling this with the non-local player in SharedMode will return false
Note: This method asserts this in DEBUG builds when called in incorrect contexts
| bool SetPriority |
( |
PlayerRef | player, |
|
|
int | priority ) |
Sets the send priority of this object for player . Client/Server: must be called on the Server (Host or Dedicated); as it adjusts the rate at which the server sends data to the player . Shared Mode: player must be the Simulation.LocalPlayer the request is forwarded to the plugin, which adjusts the send rate for this NetworkObject back to the player .
HostMigration: Priority is not replicated state and as such is not automatically carried over during a HostMigration, if your applicatiton supports host migratiton IAfterHostMigration can be used to re-apply priorities on the new host.
- Returns
true If called from an effective context e.g calling this from a Client in Client/Server will return false, calling this with the non-local player in SharedMode will return false
Note: This method asserts this in DEBUG builds when called in incorrect contexts