The primary Fusion component for networked GameObject entities. This stores the object's network identity and manages the object's state and input authority. More...
Inherits Behaviour.
Public Member Functions | |
void | AssignInputAuthority (PlayerRef player) |
Sets which PlayerRef has Input Authority for this Object. More... | |
void | CopyStateFrom (NetworkObject source) |
Copies the entire State from another NetworkObject More... | |
void | CopyStateFrom (NetworkObjectHeaderPtr source) |
Copies the entire State from another NetworkObject based on the NetworkObjectHeaderPtr More... | |
int | GetLocalAuthorityMask () |
Gets a bitmask of AuthorityMasks flags, representing the current local authority over this NetworkObject. More... | |
delegate PriorityLevel | PriorityLevelDelegate (NetworkObject networkObject, PlayerRef player) |
Delegate for determining the priority level of a network object for a specific player. More... | |
void | ReleaseStateAuthority () |
Release the state authority over this NetworkObject on shared mode. More... | |
void | RemoveInputAuthority () |
Removes input authority from whichever player has it for this object. Only valid when called on a Host or Server peer. More... | |
delegate bool | ReplicateToDelegate (NetworkObject networkObject, PlayerRef player) |
Delegate for determining if a network object should be replicated to a specific player. More... | |
void | RequestStateAuthority () |
Request state authority over this NetworkObject on shared mode. More... | |
void | SetPlayerAlwaysInterested (PlayerRef player, bool alwaysInterested) |
Add or remove specific player interest in this NetworkObject. Only the NetworkObject State Authority can set interest. More... | |
Public Member Functions inherited from Behaviour | |
T | AddBehaviour< T > () |
Wrapper for Unity's GameObject.AddComponent() More... | |
T | 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 int | GetWordCount (NetworkObject obj) |
Calculates the total word count for a given NetworkObject. More... | |
static void | NetworkUnwrap (NetworkRunner runner, NetworkId wrapper, ref NetworkObject result) |
Return the NetworkObject reference on result that matches the provided NetworkId More... | |
static NetworkId | NetworkWrap (NetworkObject obj) |
Return the obj NetworkId. More... | |
static NetworkId | NetworkWrap (NetworkRunner runner, NetworkObject obj) |
Return the obj NetworkId. More... | |
static implicit | operator NetworkId (NetworkObject obj) |
Converts the Network Object to it's NetworkId. More... | |
Static Public Member Functions inherited from Behaviour | |
static void | DestroyBehaviour (Behaviour behaviour) |
Wrapper for Unity's GameObject.Destroy() More... | |
Public Attributes | |
NetworkObjectFlags | Flags |
Flags used for network object prefabs and similar More... | |
bool | ForceRemoteRenderTimeframe = false |
Force the RenderTimeframe used to RenderTimeframe.Remote More... | |
bool | IsResume |
Signal that this NetworkObject comes from a Resume Spawn More... | |
NetworkObject[] | NestedObjects |
Array of initial child nested NetworkObject entities, that are children of this Object. More... | |
NetworkBehaviour[] | NetworkedBehaviours |
Array of all NetworkBehaviours associated with this network entity. More... | |
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. More... | |
PriorityLevelDelegate | PriorityCallback |
Delegate callback used to override priority value for a specific object-player pair More... | |
ReplicateToDelegate | ReplicateTo |
Delegate callback used to override if an object should be replicate to a client or not More... | |
uint | SortKey |
Used for whenever objects need to be sorted in a deterministic order, like when registering scene objects. More... | |
Protected Member Functions | |
virtual void | Awake () |
Awake is called when the script instance is being loaded. More... | |
virtual void | OnDestroy () |
OnDestroy is called when the script instance is being destroyed. More... | |
Properties | |
bool | HasInputAuthority [get] |
Returns if Simulation.LocalPlayer is the designated Input Source for this network entity. More... | |
bool | HasStateAuthority [get] |
Returns if Simulation.LocalPlayer is the designated State Source for this network entity. More... | |
NetworkId? | Id [get] |
The unique identifier for this network entity. More... | |
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. More... | |
bool | IsInSimulation [get] |
If this object is inserted into the simulation More... | |
bool | IsNested [get] |
Returns true if this object is nested in a prefab instance. More... | |
bool | IsProxy [get] |
Returns if Simulation.LocalPlayer is neither the Input nor State Source for this network entity. More... | |
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. More... | |
bool | IsValid [get] |
Returns if this network entity is associated with its NetworkRunner, and that runner is not null. More... | |
Tick | LastReceiveTick [get] |
Last tick this object received an update. More... | |
string | Name [get] |
The ID + Unity GameObject name for this entity. More... | |
NetworkObject | NestingRoot [get] |
Returns root of this prefab instance, if this object is nested. More... | |
RenderSource | RenderSource [get, set] |
Returns the Fusion.RenderSource for this Fusion.NetworkBehaviour instance, indicating how snapshot data will be used to render it. More... | |
float | RenderTime [get] |
Returns the current interpolation time for this object More... | |
RenderTimeframe?? | RenderTimeframe [get] |
Returns the Fusion.RenderTimeframe for this Fusion.NetworkBehaviour instance, indicating what snapshot data will be used to render it. More... | |
NetworkRunner | Runner [get] |
The NetworkRunner this entity is associated with. More... | |
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. More... | |
The primary Fusion component for networked GameObject entities. This stores the object's network identity and manages the object's state and input authority.
void AssignInputAuthority | ( | PlayerRef | player | ) |
Sets which PlayerRef has Input Authority for this Object.
|
protectedvirtual |
Awake is called when the script instance is being loaded.
void CopyStateFrom | ( | NetworkObject | source | ) |
Copies the entire State from another NetworkObject
source | NetworkObject to copy the State from |
void CopyStateFrom | ( | NetworkObjectHeaderPtr | source | ) |
Copies the entire State from another NetworkObject based on the NetworkObjectHeaderPtr
source | NetworkObjectHeaderPtr to copy the state from |
int GetLocalAuthorityMask | ( | ) |
Gets a bitmask of AuthorityMasks flags, representing the current local authority over this NetworkObject.
|
static |
Calculates the total word count for a given NetworkObject.
obj | The NetworkObject for which the word count is to be calculated. |
System.Exception | Thrown when a NetworkBehaviour reference is missing in the NetworkBehaviour array of the NetworkObject. |
|
static |
Return the NetworkObject reference on result that matches the provided NetworkId
runner | The NetworkRunner that will be used to try to find a NetworkObject with ID equals to wrapper |
wrapper | The NetworkId to be searched |
result | The found NetworkObject. null if the provided NetworkId is not valid |
|
static |
Return the obj NetworkId.
obj | The NetworkObject to get the ID from |
|
static |
Return the obj NetworkId.
runner | The NetworkRunner that obj is assigned to |
obj | The NetworkObject to get the ID from |
|
protectedvirtual |
OnDestroy is called when the script instance is being destroyed.
|
static |
delegate PriorityLevel PriorityLevelDelegate | ( | NetworkObject | networkObject, |
PlayerRef | player | ||
) |
Delegate for determining the priority level of a network object for a specific player.
networkObject | The network object in question. |
player | The player for whom the priority level is being determined. |
void 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.
networkObject | The network object in question. |
player | The player to potentially replicate to. |
void RequestStateAuthority | ( | ) |
Request state authority over this NetworkObject on shared mode.
void SetPlayerAlwaysInterested | ( | PlayerRef | player, |
bool | alwaysInterested | ||
) |
Add or remove specific player interest in this NetworkObject. Only the NetworkObject State Authority can set interest.
player | The player to set interest for |
alwaysInterested | If the player should always be interested in this object |
NetworkObjectFlags Flags |
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.
PriorityLevelDelegate PriorityCallback |
Delegate callback used to override priority value for a specific object-player pair
ReplicateToDelegate ReplicateTo |
Delegate callback used to override if an object should be replicate to a client or not
uint SortKey |
Used for whenever objects need to be sorted in a deterministic order, like when registering scene objects.
|
get |
Returns if Simulation.LocalPlayer is the designated Input Source for this network entity.
|
get |
Returns if Simulation.LocalPlayer is the designated State Source for this network entity.
|
get |
The unique identifier for this network entity.
|
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.
|
get |
If this object is inserted into the simulation
|
get |
Returns true if this object is nested in a prefab instance.
|
get |
Returns if Simulation.LocalPlayer is neither the Input nor State Source for this network entity.
|
getset |
Toggles if this NetworkObject is included in the NetworkProjectConfig.PrefabTable, which will include the prefab in builds as a Spawnable object.
|
get |
Returns if this network entity is associated with its NetworkRunner, and that runner is not null.
|
get |
Last tick this object received an update.
|
get |
The ID + Unity GameObject name for this entity.
|
get |
Returns root of this prefab instance, if this object is nested.
|
getset |
Returns the Fusion.RenderSource for this Fusion.NetworkBehaviour instance, indicating how snapshot data will be used to render it.
|
get |
Returns the current interpolation time for this object
Returns the Fusion.RenderTimeframe for this Fusion.NetworkBehaviour instance, indicating what snapshot data will be used to render it.
|
get |
The NetworkRunner this entity is associated with.
|
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.