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, and ILogBuilder.
|
void | AssignInputAuthority (PlayerRef player) |
| Sets which PlayerRef has Input Authority for this Object.
|
|
void | CopyStateFrom (NetworkObject source) |
| Copies the entire State from another NetworkObject
|
|
void | CopyStateFromSceneObject (NetworkObjectHeaderPtr source) |
| Copies the entire State from another Scene NetworkObject. They must have the same Scene Guid.
|
|
int | GetLocalAuthorityMask () |
| Gets a bitmask of AuthorityMasks flags, representing the current local authority over this NetworkObject.
|
|
void | ReleaseStateAuthority () |
|
void | RemoveInputAuthority () |
| Removes input authority from whichever player has it for this object. Only valid when called on a Host or Server peer.
|
|
void | RequestStateAuthority () |
|
void | SetInterestGroup (PlayerRef player, string group, bool interested) |
| Add or remove Player's interest in a specific named Interest Group for this NetworkObject.
|
|
void | SetPlayerAlwaysInterested (PlayerRef player, bool alwaysInterested) |
| Add or remove specific player interest in this NetworkObject.
|
|
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()
|
|
|
NetworkObjectFlags | Flags |
| Flags used for network object prefabs and similar.
|
|
NetworkId | Id |
| The unique identifier for this network entity.
|
|
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.
|
|
NetworkObjectGuid | NetworkGuid |
| The GUID for this prefab or scene object, which is set at development time. Used to reference this as a spawnable object. All spawned instances of this object will retain this GUID. Use NetworkId for the unique ID of network entries.
|
|
PredictionData | PredictedSpawn |
|
NetworkRunner | Runner |
| The NetworkRunner this entity is associated with.
|
|
SimulationBehaviour[] | SimulationBehaviours |
| Array of all SimulationBehaviours associated with this network entity. This does not include NetworkBehaviour derived classes, as they are stored in NetworkedBehaviours.
|
|
|
const int | DefaultExecutionOrder = 500 |
|
|
virtual void | Awake () |
|
virtual void | OnDestroy () |
|
|
int | AreaOfInterestLayerMask [get] |
| The layers this object exists in for area of interest queries. This is an integer bitmask not a layer index.
|
|
bool | HasInputAuthority [get] |
| Returns if Simulation.LocalPlayer is the designated Input Authority for this network entity.
|
|
bool | HasStateAuthority [get] |
| Returns if Simulation.LocalPlayer is the designated State Authority 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] |
| If this object is inserted into the simulation.
|
|
bool | IsPredictedDespawn [get] |
| If this is a predicted spawned object.
|
|
bool | IsPredictedSpawn [get] |
| If this is a predicted spawned object.
|
|
bool | IsProxy [get] |
| Returns if Simulation.LocalPlayer is neither the Input nor State Authority for this network entity.
|
|
bool | IsSceneObject [get] |
| Returns true if this network entity existed as part of a scene, rather than having been dynamically spawned.
|
|
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 | IsSpawnedPrefabNestedObject [get] |
| Returns true if this network entity is a spawned prefab's nested object, rather than being a scene object or a root prefab object.
|
|
bool | IsSpawnedPrefabRoot [get] |
| Returns true if this network entity is a spawned prefab's root, rather than being a scene object or a nested prefab object.
|
|
bool | IsValid [get] |
| Returns if this network entity is associated with its NetworkRunner, and that runner is not null.
|
|
Tick | LastReceiveTick [get] |
| Last tick this object received an update. Only available for SimulationConfig.StateReplicationModes.EventualConsistency.
|
|
string | Name [get] |
| The ID + Unity GameObject name for this entity.
|
|
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.
◆ CopyStateFrom()
Copies the entire State from another NetworkObject
- Parameters
-
source | NetworkObject to copy the State from |
◆ CopyStateFromSceneObject()
void CopyStateFromSceneObject |
( |
NetworkObjectHeaderPtr |
source | ) |
|
Copies the entire State from another Scene NetworkObject. They must have the same Scene Guid.
- Parameters
-
source | Scene NetworkObject to copy the State from. |
◆ SetInterestGroup()
void SetInterestGroup |
( |
PlayerRef |
player, |
|
|
string |
group, |
|
|
bool |
interested |
|
) |
| |
Add or remove Player's interest in a specific named Interest Group for this NetworkObject.
SimulationConfig.ReplicationMode must be set to SimulationConfig.StateReplicationModes.EventualConsistency.
◆ SetPlayerAlwaysInterested()
void SetPlayerAlwaysInterested |
( |
PlayerRef |
player, |
|
|
bool |
alwaysInterested |
|
) |
| |
Add or remove specific player interest in this NetworkObject.
SimulationConfig.ReplicationMode must be set to SimulationConfig.StateReplicationModes.EventualConsistency.
- Parameters
-