Fusion.Runtime
Memory Allocator
Heap Alignment
Replicate Word Shift
Replicate Word Size
Replicate Word Align
Bucket Count
Bucket Invalid
Check size of bytes to be allocated
Number of bytes to be allocated
True if size is valid, false otherwise.
If size is less than 1
If size is bigger than
Memory Allocator Configuration
Config Size
Default Block Shift
Default Block Count
Block Shift Config value
Block Count Config value
Globals Size Config value
Block Size in Bytes
Block Size in Words
Heap Size in Bytes
Heap Size Allocated in Bytes
Config Constructor
Block Shift
Block Count
Globals Size
Check Config equality
Config Ref
True if has the same values
Check Config equality
Any object reference
True if obj is a and has the same values
Get Hash Code
Hash Code
Config ToString
Page Bit Shift Lookup Table
Ptr
Ptr Equality Comparer
Ptr Equality Comparer
Ptr X
Ptr Y
True if point to the same Address
Get Hash Code
Ptr
Ptr Address
Ptr Size
Null Ptr
Ptr Address
Check Ptr equality
Ptr Ref
True if points to the same Address
Check Ptr equality
Any object reference
True if obj is a and points to the same Address
Hash Code, same as
to String
in Hexadecimal format
Implicit Bool Operator
Check if is not 0
to check
True if is not 0
Implicit Ptr Equals Operator
A
B
True if is the same
Implicit Ptr Not Equals Operator
A
B
True if is not the same
Implicit Ptr Sum Operator
to add to
Value to add
with increased by
Implicit Ptr Subtraction Operator
to subtract from
Value to subtract
with decreased by
Capacity Attribute
Total Capacity
CapacityAttribute Constructor
Default For Property Attribute
For non-serialized properties
Property Name
Property Word Offset
Property Word Count
DefaultForPropertyAttribute Constructor
Fixed Buffer Property Attribute
Fixed Buffer Type
Fixed Buffer Surrogate Type
Fixed Buffer Capacity
FixedBufferPropertyAttribute Constructor
Network Assembly Ignore Attribute
Network Assembly Weaved Attribute
Network Behaviour Weaved Attribute
Word Count
NetworkBehaviourWeavedAttribute Constructor
Network Deserialize Method Attribute
Flags a property of for network state synchronization.
The property should have empty get and set defines, which will automatically be replaced with networking code via IL Weaving.
Inside of INetworkStruct, do not use AutoProperties (get; set;), as these will introduce managed types into the struct, which are not allowed. Instead use '=> default'.
| [Networked]
| public string StringProp { get => default; set { } }
Name of the field that holds the default value for this networked property.
Default constructor for NetworkedAttribute
OnChangedRender Attribute
This attribute is used to specify a method that should be called when the property changes.
Gets the name of the method to be called when the property changes.
Initializes a new instance of the class.
The name of the method to be called when the property changes.
Thrown when is null or empty.
Networked Weaved Attribute
Networked Property Attribute
Networked Property Word Offset
Networked Property Word Count
NetworkedWeavedAttribute Constructor
Network Input Weaved Attribute
Word Count
NetworkInputWeavedAttribute Constructor
Network Prefab Attribute
Network Rpc Static Weaved Invoker Attribute
Contains info about a static weaved RPC Method
RPC Key
NetworkRpcStaticWeavedInvokerAttribute Constructor
Network Rpc Weaved Invoker Attribute
Contains info about a weaved RPC Method
RPC Key
RPC Sources
RPC Targets
NetworkRpcWeavedInvokerAttribute Constructor
Network Serialize Method Attribute
If set, this changes expected Wrap method signature to int Name(NetworkRunner, T, byte*) and Unwrap to int Name(NetworkRunner, byte*, ref T).
In both cases, the result is the number of bytes written/read and can not be greater than what's declared here.
Describes the total number of WORDs a uses.
Word Count
If the is Generic Composite
NetworkStructWeavedAttribute Constructor
word count
Enables a special inspector drawer for Unity Rect type, specially designed for editing RectTransforms using normalized values.
Signal if Y should be inverted
Set the Aspect Ratio
Constructor for . InvertY inverts Y handling, for RectTransforms which treat lowerRight as origin, rather than upper left.
Invert Y handling
Expressed as Width/Height, this defines the ratio of the box shown in the inspector. Value of 0 indicates game window resolution will be used.
Preserve In Plugin Attribute
PreserveInPluginAttribute Constructor
Override default render settings for [Networked] properties.
Force this property to be rendered in this .
This setting is prioritized over and overrides.
Force this property to be rendered using this (in the chosen ).
This setting is prioritized over and overrides.
Override the default interpolation method for this property. The method's signature must match:
static T MethodName(T from, T to, float alpha) { /* ... */ }
Default constructor for RenderAttribute
RenderAttribute Constructor
reference
reference
Render Weaved Attribute
RenderWeavedAttribute Constructor
Resolve Network Prefab Source Attribute
Unity ContextMenuItemAttribute
ContextMenuItemAttribute Order
ContextMenuItemAttribute Constructor
Unity DelayedAttribute
DelayedAttribute Order
Unity HeaderAttribute
HeaderAttribute Order
HeaderAttribute Constructor
Unity MinAttribute
MinAttribute Order
MinAttribute Constructor
Unity MultilineAttribute
MultilineAttribute Order
Unity NonReorderableAttribute
NonReorderableAttribute Order
Unity RangeAttribute
RangeAttribute Order
RangeAttribute Constructor
Unity SerializeField
Unity SerializeReference
Unity SpaceAttribute
SpaceAttribute Order
SpaceAttribute Constructor
Unity TooltipAttribute
TooltipAttribute Order
TooltipAttribute Constructor
Unity NonSerializedAttribute
Unity FormerlySerializedAsAttribute
FormerlySerializedAsAttribute Constructor
Weaver Generated Attribute
Wrapper around the Fusion LBC Implementation
It will control and manage the communication between Fusion and the Photon Cloud
Fusion LBC Client Reference
ID of this Communicator. This reflects the Actor Number of the Peer inside the Room
Flag to signal if this Communicator was extracted and will be reused
Responsible to deal with LoadBalancingClient Events
Responsible for dealing and managing the API used to communicate with the Photon Cloud.
This also includes:
- Send/Reply to Protocol Messages
- Query for Reflexive Information
- Perform NAT Punchthrough
- Manage the Realtime client
- Respond to/deal with Photon Cloud events
Signal if the local peer is connected to the Photon Cloud and can perform extra actions, like creating/joining a Room.
Photon Client UserID
Signal if the local peer is already inside a Room
Signal if the local peer is already inside a Lobby
Current Fusion Session Join Stage
Current ProtocolMessageVersion
Max Number of players a Session can handle
Signal if the local peer is also the Master Client of the Current Room
Get the internal used by the Client to perform the authentication
Reference to the current active communicator
Get the local client cached region summary
Signal if the local peer will try or accept connections using NAT Punch
Flag to signal if the Photon Cloud connection is encrypted by default
Custom STUN Server
Exposes the current NAT Type from the local Peer
player ref assigned by the cloud
Builds a new CloudService reference
Reference to the current active Runner
Custom Photon App Settings
Optional external Communicator
Extract the internal Communicator for later re-use
Current used by this instance with all resetted settings
Update and perform all pending actions related to the Photon Cloud communication
Connect the local peer to Photon Cloud using an async process.
Custom Authentication Values used to Auth the local peer
Custom Photon App Settings
External CancellationToken
Signal if the LoadBalancingClient should use the Default or Alternative Ports
Async Task of the connect to Photon Cloud process. Can be used to wait for the process to be finished
Join the Peer to a specific Lobby, either a prebuild or a custom one
Lobby Type to Join
Custom Lobby ID
Custom Lobby Type
True if the operation could be completed.
Make the local Peer Create/Join a Room based on Start Game Arguments
--------------------->Yes--->CreateOrJoin
SharedMode--->| Valid Room Name |
--------------------->No---->[RandomRoomName]-->JoinRandomOrCreate
--------------------->Yes--->CreateOrJoin
ClientMode--->| Valid Room Name |
--------------------->No---->[RandomRoomName]-->JoinRandom
ServerMode-- --------------------->Yes----------------------------|
|->| Valid Room Name | v
HostMode---- --------------------->No---->[RandomRoomName]-->CreateOrJoin
Start Game Args ref
External Cancellation Token
Task of the Join Room process
Disconnect the Local Peer from the Photon Cloud.
Async Task of the disconnect from Photon Cloud process. Can be used to wait for the process to be finished
Get the UserID of another Player Actor in the Room
ActorID of a Player inside the Room
Player UserID
Try to get the ActorId associated with a specific Client Unique Id
Client Unique Id to check
ActorId associated with that Client Unique Id
True if the ActorId can be found
Callback fire on every connection attempt with a remote Server.
It is used while trying to hole-punch the remote server and enables the manager to swap the target endpoint in between attempts.
This is necessary to maintain a flow of attempts even if we exchange the local/public/relay endpoints
Current attempt number
Max number of attempts
Flag if target EndPoint should change
New target EndPoint
Start the connection process with a Remote Server
Starting NAT Punch state, see for more info
Remote Server EndPoint to connect to
Disposes the current
Callback invoked when any Room Property has changed
Callback invoked when the Room list is updated with data from the Cloud
New List of
Send a Protocol Message to Fusion Plugin
Optional external cancellation token
Send a Protocol Message to the Fusion Plugin
Reference to the Project Config to be sent
Send a Protocol Message to the Fusion Plugin
Reference to StunResult used to build the Protocol Message
Build and send the latest Server Snapshot to the Fusion Plugin
Handles a Confirmation Protocol Message sent by the Fusion Plugin
Sender Actor Number
Join Protocol Message
Handles a Protocol Message sent by the Fusion Plugin
Sender Actor Number
Start Protocol Message
Handles a Protocol Message sent by the Fusion Plugin
Sender Actor Number
Disconnect Protocol Message
Handles a Protocol Message sent by the Fusion Plugin
Sender Actor Number
NetworkConfigSync Protocol Message
Handles a Protocol Message sent by the Fusion Plugin
Sender Actor Number
ReflexiveInfo Protocol Message
Confirms or waits for confirmation from the Plugin of the Join Message
True if the Join Confirmation was received, false otherwise
Send an empty message to Photon Cloud so the LBC Connection keeps alive
Periodically sends a host migration snapshot if the runner is in host mode and is currently running.
A task that represents the asynchronous operation. The task result is a boolean indicating whether the service should continue running.
Returns true if the runner is not running, indicating that the service should continue.
Returns false if the runner is not in host mode, indicating that the service should stop.
Thrown when the operation is cancelled.
Reverse ping will send Empty UDP Packets to the RemoteAddr in order to setup the Routing Table
on the current NAT of the Server, forcing it to allow packages from the remote client to be received
Remove EndPoint to ping
Run the STUN Service to retrieve the current Reflexive Addresses of the local peer
Running Task of the STUN Query Procedure
Update the internal used to start the Fusion Runner
New arguments
Check if Remote Private EndPoint appears to be in the same Subnet
True if in same Subnet
Initilize the Log system from the Realtime SDK to use the Fusion Log System
Converts a to a
ref
Room Region
ref
Holds information about the local peer used to Join/Start/Connect to a remote Peer
using the Photon Cloud as backend
Client Server Lobby
Shared Lobby
Reference to the initialization arguments set by the user.
They are used to start the Fusion Runner
Connection Stage related to the current EndPoint Type used by the client to connect a remote server
Describes the current state of the Join process
Describe the current protocol version we are using to communicate with the Plugin
Remote Server Reflexive Info. Stores private and public EndPoint of the remote server.
Local Reflexive Info. Stores private and public EndPoint of the local peer.
Stores the local peer Unique Id
Stores the local peer Unique Id
Stores the local Encryption Token
Stores requests sent by the plugin
Last Disconnect Msg Received from the Plugin
Mapping between Actor UniqueId and its ReflexiveInfo
Define a list of Requests that may be asked by the Plugin Server
No Request
Request for the Local Reflexive Info
Describes the current Target Address Type used in the NAT Punch procedure
No connection procedure is running
Trying to Connect to LAN EndPoint
Trying to Connect to WAN EndPoint
Trying to Connect to Relay EndPoint
Stage of the Join Process.
When starting the peer, the first thing we need to make sure is to have Joined the Room
with a confirmation from the Plugin, this will signal the current stage of this
Join Request not sent yet
Join Request Sent, waiting for confirmation
Join Confirmation Received, all good
Failed to receive Join Confirmation after a timeout
Stores the data of a "Request to Ping" used by the Server in Client-Server Mode
to send arbitrary "pings" to a connecting Client.
This allows the local NAT Table to be updated with the right mapping information
from the remote client, increasing the chance of the local Server to receive any
connect request from the remote peer.
Delay between pings
Total number of pings to send
Countdown for the next ping
Remote Client Reflexive Info, used to getter the Public EndPoint to send the ping
Extension methods to
Holds information about a Lobby
Flag to signal if the is ready for use.
This is only true if the peer is currently connected to a Lobby.
Lobby Name
Stores the current connected Region
Session Lobby Type
Invalid Session Lobby Type
ClientServer Lobby
Shared Lobby
Custom Lobby - works in conjuction with a Lobby Name/ID
Holds information about the Game Session
Flag to signal if the is ready for use
Stores the current Room Name
Stores the current connected Region
Signal if the current connected Room is visible
Signal if the current connected Room is open
Room Custom Properties
Current number of peers inside this Session, this includes the Server/Host and Clients
Max number of peer that can join this Session, this value always include an extra slot for the Server/Host
Check if the reference is not Null and is Valid.
Session Info
Update or change the Custom Properties of the current joined Room
New custom properties
String representation of a
Formatted
Interface for callback.
Called after the re-simulation loop (when applicable), and also after the forward simulation loop.
Implement this interface on and classes.
Called after the re-simulation loop (when applicable), and also after the forward simulation loop.
Only called on Updates where re-simulation or forward ticks are processed.
True if this is being called during the re-simulation loop. False if during the forward simulation loop.
How many re-simulation or forward ticks are going to be processed.
Callback interface for .
Called at the very start of the resimulation loop (on clients with prediction enabled),
immediately after state is set to the latest server snapshot.
Implement this interface on and classes.
Called at the very start of the resimulation loop (on clients with prediction enabled),
immediately after state is set to the latest server snapshot.
Used to mark NetworkBehaviors that need to be react after a Host Migration process
Invoked after the Host Migration happens in order to setup non-networked data on NetworkBehaviors
Interface for callback.
Called after the render loop.
Called after the render loop.
Interface for callback.
Called after the object is spawned.
Called after the object is spawned.
Interface for callback.
Called after each tick simulation completes.
Implement this interface on and classes.
Called after each tick simulation completes.
Interface for the callback, which is called at the end of each Fusion Update segment.
Implement this interface on and classes.
Called at the end of the Fusion Update loop, before all Unity MonoBehaviour.Update() callbacks.
Interface for callback.
Called before the re-simulation loop (when applicable), and also before the forward simulation loop.
Implement this interface on and classes.
Called before the re-simulation loop (when applicable), and also before the forward simulation loop.
Only called on Updates where re-simulation or forward ticks are processed.
True if this is being called during the re-simulation loop. False if during the forward simulation loop.
How many re-simulation or forward ticks are going to be processed.
Callback interface for .
Called at the very start of the re-simulation loop (on clients with prediction enabled),
before state is set to the latest server snapshot.
Implement this interface on and classes.
Called at the very start of the re-simulation loop (on clients with prediction enabled),
before state is set to the latest server snapshot.
Interface for callback.
Called before the copy of the previous state.
Called before the copy of the previous state.
Interface for callback.
Implement this interface on and classes.
Called immediately before the registers hitboxes in a snapshot.
Interface for callback.
Called before both the re-simulation (when applicable) and forward simulation loops.
Implement this interface on and classes.
Called before both the re-simulation (when applicable) and forward simulation loops.
Only called on updates that have forward ticks to process.
How many forward ticks are going to be processed.
Interface for callback.
Called before each tick is simulated.
Implement this interface on and classes.
Called before each tick is simulated.
Interface for the callback, which is called at the beginning of each Fusion Update segment.
Implement this interface on and classes.
Called at the start of the Fusion Update loop, before the Fusion simulation loop.
Interface for callback.
Called when a is despawned.
Called when a is despawned.
NetworkRunner that despawned the .
Whether the has state.
Interface for handling the event when a player enters the area of interest.
Method to be called when a player enters the area of interest.
The player who entered the area of interest.
Interface for handling the event when a player exits the area of interest.
Method to be called when a player exits the area of interest.
The player who exited the area of interest.
Interface for handling the event when a local prefab is created.
Method to be called when a local prefab is created.
Interface for handling the event when a player joins the game.
Method to be called when a player joins the game.
The player who joined the game.
Interface for handling the event when a player leaves the game.
Method to be called when a player leaves the game.
The player who left the game.
Interface for handling the event when a remote prefab is created.
Method to be called when a remote prefab is created.
Interface for handling the event when a scene load operation is completed.
Method to be called when a scene load operation is completed.
The information about the loaded scene.
Struct that contains information about a scene after it has been loaded.
Reference to the loaded scene.
Array of NetworkObjects present in the loaded scene.
The loaded Unity scene.
Array of root GameObjects present in the loaded Unity scene.
Constructs a new SceneLoadDoneArgs struct.
Reference to the loaded scene.
Array of NetworkObjects present in the loaded scene.
The loaded Unity scene.
Array of root GameObjects present in the loaded Unity scene.
Interface for handling the event when a scene load operation is started.
Method to be called when a scene load operation is started.
Reference to the scene that is being loaded.
Interface for callback.
Called when the joins AreaOfInterest.
Implement this interface on and classes.
Called when the joins AreaOfInterest.
Object is now receiving snapshot updates.
Object will execute FixedUpdateNetwork() and Render() methods until the object leaves simulation.
Interface for the callback.
Called when the leaves AreaOfInterest.
Implement this interface on and classes.
Called when the leaves AreaOfInterest.
Object is no longer receiving snapshot updates.
Object will stop executing FixedUpdateNetwork() and Render() methods until the object rejoins simulation.
Interface for handling the event when an object is spawned.
Method to be called when an object is spawned.
Interface for handling the event when the state authority changes.
Method to be called when the state authority changes.
Interface for handling the event when the input authority is gained.
Method to be called when the input authority is gained.
Interface for handling the event when the input authority is lost.
Method to be called when the input authority is lost.
Base class for Fusion network components, which are associated with a .
Derived from , components derived from this class are associated with a and .
Components derived from this class are associated with a parent .
and can use the on properties to automate state synchronization,
and can use the on methods, to automate messaging.
Gets a value indicating whether the state buffer is valid.
Gets the state buffer associated with the network behaviour.
On Render Default Change Detector instance
Gives access to the offset (in 32 bit words) and count (in 32 bit words) of this behaviour backing data
The tick the data on this networked behaviour changed
The unique identifier for this network behaviour.
Returns true if the of the associated is the designated as Input Source for this network entity.
Returns true if the associated is the State Source for this network entity.
Returns true if the associated is neither the Input nor State Authority for this network entity.
It is recommended to use ! or ! when possible instead,
as this check requires evaluating both authorities - and is therefore less performant than the individual checks.
Override this value for custom memory allocations.
This is for advanced use cases only, and cannot be used if is used in the derived class.
Returns true if the object is writable in the editor - i.e. when it is not attached
or has the state authority.
Gets a bitmask of flags, representing the current local authority over this .
Controls if this network behaviours state is replicated to a player or not
The player to change replication status for
true = replicate, false = don't replicate
Sets the default replicated state for this behaviour, this by default is true so calling ReplicateToAll(true) does nothing if ReplicateToAll(false) hasn't been called before
The default state of this behaviour
Resets the state of the object to the original state
Copies entire state of passed in source
Source to copy data from
Fixed update callback for networked behaviours.
Copies the backing fields to the state. This method is meant to be overridden in derived classes.
Indicates whether this is the first time the method is called.
Copies the state to the backing fields. This method is meant to be overridden in derived classes.
Post spawn callback.
Called before the network object is despawned
The runner that owns the object
If the state of the behaviour is still accessible
Allows read and write access to the internal state buffer
The offset to generate a ref for, in integer words
The type of the ref to generate
Reference to the location in memory defined by offset
Provides a reader for network arrays of type T.
The type of elements in the network array.
Contains data about the property to be read.
Contains the reader for the elements in the network array.
Reads a network array from the provided network behaviour buffer.
The network behaviour buffer to read the network array from.
A read-only view of the network array.
Provides a reader for network linked lists of type T.
The type of elements in the network linked list.
Contains data about the property to be read.
Contains the reader for the elements in the network array.
Reads a network linked list from the provided network behaviour buffer.
The network behaviour buffer to read the network linked list from.
A read-only view of the network linked list.
Provides a reader for network dictionaries with keys of type K and values of type V.
The type of keys in the network dictionary.
The type of values in the network dictionary.
Contains data about the property to be read.
Contains the reader for the keys in the network dictionary.
Contains the reader for the values in the network dictionary.
Reads a network dictionary from the provided network behaviour buffer.
The network behaviour buffer to read the network dictionary from.
A read-only view of the network dictionary.
Provides a reader for network behaviours of type T.
The type of the network behaviour.
The NetworkRunner associated with the network behaviour.
The reader for the network behaviour's ID.
Reads a network behaviour from the provided network behaviour buffer.
The network behaviour buffer to read the network behaviour from.
The network behaviour of type T read from the buffer. Returns null if the behaviour is not found.
Reads two network behaviours from the provided network behaviour buffers.
The first network behaviour buffer to read the network behaviour from.
The second network behaviour buffer to read the network behaviour from.
A tuple containing the two network behaviours of type T read from the buffers.
Provides a reader for properties of type T in a network behaviour.
The type of the property in the network behaviour. Must be unmanaged.
Contains data about the property to be read.
Constructs a new PropertyReader with the provided data.
The data about the property to be read.
Constructs a new PropertyReader with the provided offset.
The offset of the property in the network behaviour buffer.
Reads a property of type T from the provided network behaviour buffer.
The network behaviour buffer to read the property from.
The property of type T read from the buffer.
Reads a property of type T from the provided network behaviour buffers.
The first network behaviour buffer to read the property from.
The second network behaviour buffer to read the property from.
A tuple containing the property of type T read from the first and second buffers.
Gets a BehaviourReader for a network behaviour of type T.
The type of the network behaviour.
The name of the property to be read.
A BehaviourReader for the network behaviour of type T.
Gets an ArrayReader for a network array of type T.
The type of elements in the network array.
The name of the property to be read.
An ArrayReader for the network array of type T.
Gets a LinkListReader for a network linked list of type T.
The type of elements in the network linked list.
The name of the property to be read.
A LinkListReader for the network linked list of type T.
Gets a DictionaryReader for a network dictionary with keys of type K and values of type V.
The type of keys in the network dictionary.
The type of values in the network dictionary.
The name of the property to be read.
A DictionaryReader for the network dictionary with keys of type K and values of type V.
Gets a BehaviourReader for a network behaviour of type T.
The type of the network behaviour.
The NetworkRunner associated with the network behaviour.
The type of the behaviour to be read.
The name of the property to be read.
A BehaviourReader for the network behaviour of type T.
Gets a BehaviourReader for a network behaviour with a specific property of type TProperty.
The type of the network behaviour.
The type of the property in the network behaviour.
The NetworkRunner associated with the network behaviour.
The name of the property to be read.
A BehaviourReader for the network behaviour with the specific property of type TProperty.
Gets a PropertyReader for a property of type TProperty in a network behaviour of type TBehaviour.
The type of the network behaviour.
The type of the property in the network behaviour. Must be unmanaged.
The name of the property to be read.
A PropertyReader for the property of type TProperty in the network behaviour of type TBehaviour.
Gets a PropertyReader for a property of type T in a network behaviour of a specific type.
The type of the property in the network behaviour. Must be unmanaged.
The type of the network behaviour.
The name of the property to be read.
A PropertyReader for the property of type T in the network behaviour of the specified type.
Gets an ArrayReader for a network array of type T in a network behaviour of a specific type.
The type of elements in the network array.
The type of the network behaviour.
The name of the property to be read.
An ArrayReader for the network array of type T in the network behaviour of the specified type.
Gets a DictionaryReader for a network dictionary with keys of type K and values of type V in a network behaviour of a specific type.
The type of keys in the network dictionary.
The type of values in the network dictionary.
The type of the network behaviour.
The name of the property to be read.
A DictionaryReader for the network dictionary with keys of type K and values of type V in the network behaviour of the specified type.
Gets a LinkListReader for a network linked list of type T in a network behaviour of a specific type.
The type of elements in the network linked list.
The type of the network behaviour.
The name of the property to be read.
A LinkListReader for the network linked list of type T in the network behaviour of the specified type.
Gets a PropertyReader for a property of type T in this network behaviour.
The type of the property in the network behaviour. Must be unmanaged.
The name of the property to be read.
A PropertyReader for the property of type T in this network behaviour.
Creates a ChangeDetector for this network behaviour.
The source of the change detector.
Indicates whether to copy the initial state of the network behaviour.
A ChangeDetector for this network behaviour.
Tries to get the snapshot buffers for this network behaviour.
The buffer representing the state of the network behaviour at the start of the render frame.
The buffer representing the state of the network behaviour at the end of the render frame.
The interpolation factor between the start and end of the render frame.
True if the snapshot buffers are valid, false otherwise.
Determines whether to replicate the network behaviour to the specified player.
This method can be overridden in derived classes to implement custom replication logic.
The player to potentially replicate the network behaviour to.
True if the network behaviour should be replicated to the player, false otherwise. The default implementation always returns true.
Returns true if it a valid can be found for the current simulation tick (Typically this is used in ).
The returned input struct originates from the ,
and if valid contains the inputs supplied by that for the current simulation tick.
Serializes a NetworkBehaviour into a byte array.
The NetworkBehaviour to be serialized.
The byte pointer to write the serialized data to.
The size of the serialized data in bytes.
Serializes a NetworkBehaviour into a byte array.
The NetworkBehaviour to be serialized.
The byte pointer to write the serialized data to.
The size of the serialized data in bytes.
Deserializes a NetworkBehaviour from a byte array.
The NetworkRunner associated with the NetworkBehaviour.
The byte pointer to read the serialized data from.
The NetworkBehaviour to store the deserialized data in.
The size of the deserialized data in bytes.
Converts a NetworkBehaviour to a NetworkBehaviourId.
The NetworkRunner associated with the NetworkBehaviour.
The NetworkBehaviour to be converted.
A NetworkBehaviourId representing the NetworkBehaviour. If the NetworkBehaviour is null or its NetworkObject's Id is default, returns a default NetworkBehaviourId.
Converts a NetworkBehaviourId to a NetworkBehaviour.
The NetworkRunner associated with the NetworkBehaviour.
The NetworkBehaviourId to be converted.
The NetworkBehaviour represented by the NetworkBehaviourId. If the NetworkBehaviourId is not valid or a NetworkBehaviour with the NetworkBehaviourId does not exist, returns null.
Converts NetworkBehaviour to NetworkBehaviourId
NetworkBehaviour to convert
NetworkBehaviourId representing the NetworkBehaviour
This method needs to be invoked in user overrides of:
Creates a reference to a value of type T. This method is meant to be used only for [Networked] properties inline initialization.
The type of the value. Must be unmanaged.
A reference to a value of type T.
Thrown because this method is meant to be used only for [Networked] properties inline initialization.
Creates a reference to a value of type T, initializing it with the provided default value. This method is meant to be used only for [Networked] properties inline initialization.
The type of the value. Must be unmanaged.
The default value to initialize the value with.
A reference to a value of type T.
Thrown because this method is meant to be used only for [Networked] properties inline initialization.
Creates a pointer to a value of type T. This method is meant to be used only for [Networked] properties inline initialization.
The type of the value. Must be unmanaged.
A pointer to a value of type T.
Thrown because this method is meant to be used only for [Networked] properties inline initialization.
Creates a pointer to a value of type T, initializing it with the provided default value. This method is meant to be used only for [Networked] properties inline initialization.
The type of the value. Must be unmanaged.
The default value to initialize the value with.
A pointer to a value of type T.
Thrown because this method is meant to be used only for [Networked] properties inline initialization.
This is a special method that is meant to be used only for [Networked] properties inline initialization.
This is a special method that is meant to be used only for [Networked] properties inline initialization.
Change detector for a NetworkBehaviour
This class is used to detect changes in a NetworkBehaviour.
It can be used to detect changes in a NetworkBehaviour between two snapshots, or between the current state and a snapshot.
Enum representing the source of a NetworkBehaviour's state.
The state is the current simulation state of the NetworkBehaviour.
The state is from a previous snapshot of the NetworkBehaviour.
The state is from a future snapshot of the NetworkBehaviour.
Struct representing a collection of changes detected in a NetworkBehaviour.
Array of property names that have changed.
The number of properties that have changed.
Constructor for the Enumerable struct.
Array of property names that have changed.
The number of properties that have changed.
Gets an enumerator for the collection of changes.
An Enumerator for the collection of changes.
Checks if a property has changed.
The name of the property to check.
True if the property has changed, false otherwise.
Enumerator for the collection of changes detected in a NetworkBehaviour.
Array of property names that have changed.
The number of properties that have changed.
The current index in the array of changed properties.
Gets the current property name in the array of changed properties.
Constructor for the Enumerator struct.
Array of property names that have changed.
The number of properties that have changed.
Resets the enumerator to its initial state.
Advances the enumerator to the next property in the array of changed properties.
True if the enumerator was successfully advanced to the next property, false if the enumerator has passed the end of the array.
Finalizes an instance of the class.
Initializes the ChangeDetector for a given NetworkBehaviour.
The NetworkBehaviour instance to initialize the ChangeDetector for.
The source of the NetworkBehaviour's state.
Whether to copy the initial state of the NetworkBehaviour. Defaults to true.
Detects changes in a NetworkBehaviour and returns an Enumerable of the changes.
The NetworkBehaviour instance to detect changes in.
The previous state of the NetworkBehaviour.
The current state of the NetworkBehaviour.
Whether to copy the changes detected. Defaults to true.
An Enumerable of the changes detected in the NetworkBehaviour.
Detects changes in a NetworkBehaviour and returns an Enumerable of the changes.
The NetworkBehaviour instance to detect changes in.
Whether to copy the changes detected. Defaults to true.
An Enumerable of the changes detected in the NetworkBehaviour.
Provides low level accesss to data buffers that can be read using a NetworkBehaviour.Reader
Gets the tick at which the buffer was created.
Gets the length of the buffer.
Gets a value indicating whether the buffer is valid.
A buffer is considered valid if the pointer to the start of the buffer is not null and the length of the buffer is greater than 0.
Reinterprets the state of the buffer at a given offset as a specific type.
The type to reinterpret the state as. Must be unmanaged.
The offset at which to start reinterpreting. Defaults to 0.
The state of the buffer at the given offset, reinterpreted as the specified type.
Indexer to get the value at a specific index in the buffer.
The index to get the value from.
The value at the specified index in the buffer.
Reads a NetworkBehaviour from the buffer using the provided BehaviourReader.
The type of NetworkBehaviour to read. Must be a subclass of NetworkBehaviour.
The BehaviourReader to use for reading the NetworkBehaviour.
The read NetworkBehaviour.
Reads a property from the buffer using the provided PropertyReader.
The type of the property to read. Must be unmanaged.
The PropertyReader to use for reading the property.
The read property.
Reads a float property from the buffer using the provided PropertyReader.
The PropertyReader to use for reading the float property.
The read float property.
Reads a Vector2 property from the buffer using the provided PropertyReader.
The PropertyReader to use for reading the Vector2 property.
The read Vector2 property.
Reads a Vector3 property from the buffer using the provided PropertyReader.
The PropertyReader to use for reading the Vector3 property.
The read Vector3 property.
Reads a Vector4 property from the buffer using the provided PropertyReader.
The PropertyReader to use for reading the Vector4 property.
The read Vector4 property.
Reads a Quaternion property from the buffer using the provided PropertyReader.
The PropertyReader to use for reading the Quaternion property.
The read Quaternion property.
Implicit conversion operator to bool.
This allows a NetworkBehaviourBuffer instance to be used in conditions directly.
The NetworkBehaviourBuffer instance to convert.
True if the buffer is valid, false otherwise.
The NetworkBehaviourBufferInterpolator struct is used to interpolate between two NetworkBehaviourBuffer instances.
This is a read-only, ref struct, meaning it cannot be boxed and it can only be used on the stack.
The NetworkBehaviour instance that this interpolator is associated with.
The NetworkBehaviourBuffer instance representing the "from" state for interpolation.
The NetworkBehaviourBuffer instance representing the "to" state for interpolation.
The interpolation factor, ranging from 0 to 1.
This value is used to interpolate between the "from" and "to" states.
A value indicating whether this interpolator is valid.
An interpolator is considered valid if it has successfully retrieved the "from" and "to" buffers.
Constructor for the NetworkBehaviourBufferInterpolator struct.
The NetworkBehaviour instance that this interpolator is associated with.
Gets the interpolated angle of a property.
The name of the property to get the angle of.
The interpolated angle of the property.
Gets the interpolated angle of a property.
The PropertyReader for the property to get the angle of.
The interpolated angle of the property.
Gets the interpolated float value of a property.
The name of the property to get the float value of.
The interpolated float value of the property.
Gets the interpolated float value of a property.
The PropertyReader for the property to get the float value of.
The interpolated float value of the property.
Gets the interpolated integer value of a property.
The name of the property to get the integer value of.
The interpolated integer value of the property.
Gets the interpolated integer value of a property.
The PropertyReader for the property to get the integer value of.
The interpolated integer value of the property.
Gets the interpolated boolean value of a property.
The PropertyReader for the property to get the boolean value of.
The interpolated boolean value of the property.
Gets the interpolated boolean value of a property.
The name of the property to get the boolean value of.
The interpolated boolean value of the property.
Selects the interpolated value of a property by its name.
The type of the property to select. Must be unmanaged.
The name of the property to select.
The interpolated value of the property.
Selects the interpolated value of a property.
The type of the property to select. Must be unmanaged.
The PropertyReader for the property to select.
The interpolated value of the property.
Gets the interpolated Vector3 value of a property.
The name of the property to get the Vector3 value of.
The interpolated Vector3 value of the property.
Gets the interpolated Vector3 value of a property.
The PropertyReader for the property to get the Vector3 value of.
The interpolated Vector3 value of the property.
Gets the interpolated Vector2 value of a property.
The name of the property to get the Vector2 value of.
The interpolated Vector2 value of the property.
Gets the interpolated Vector2 value of a property.
The PropertyReader for the property to get the Vector2 value of.
The interpolated Vector2 value of the property.
Gets the interpolated Vector4 value of a property.
The name of the property to get the Vector4 value of.
The interpolated Vector4 value of the property.
Gets the interpolated Vector4 value of a property.
The PropertyReader for the property to get the Vector4 value of.
The interpolated Vector4 value of the property.
Gets the interpolated Quaternion value of a property.
The name of the property to get the Quaternion value of.
The interpolated Quaternion value of the property.
Gets the interpolated Quaternion value of a property.
The PropertyReader for the property to get the Quaternion value of.
The interpolated Quaternion value of the property.
Implicit conversion operator to bool.
This allows a NetworkBehaviourBufferInterpolator instance to be used in conditions directly.
The NetworkBehaviourBufferInterpolator instance to convert.
True if the interpolator is valid, false otherwise.
Represents the unique identifier for a NetworkBehaviour instance.
Size of the NetworkBehaviourId structure in bytes.
The NetworkId of the object this behaviour belongs to.
The identifier for the behaviour within the object.
Checks if the NetworkBehaviourId is valid.
A NetworkBehaviourId is valid if its Object is valid and its Behaviour is non-negative.
Returns a new NetworkBehaviourId with default values.
Checks if this NetworkBehaviourId is equal to another NetworkBehaviourId.
Two NetworkBehaviourIds are equal if their Objects and Behaviours are equal.
The other NetworkBehaviourId to compare with.
True if the NetworkBehaviourIds are equal, false otherwise.
Checks if this NetworkBehaviourId is equal to another object.
The object is considered equal if it is a NetworkBehaviourId and its Object and Behaviour are equal to this NetworkBehaviourId's.
The object to compare with.
True if the object is a NetworkBehaviourId and is equal to this, false otherwise.
Returns a hash code for this NetworkBehaviourId.
The hash code is computed based on the Object's hash code and the Behaviour.
A hash code for this NetworkBehaviourId.
Returns a string representation of the NetworkBehaviourId.
The string representation is in the format: [Object:{Object}, Behaviour:{Behaviour}].
A string representation of the NetworkBehaviourId.
Determines whether two NetworkBehaviourId instances are equal.
Two NetworkBehaviourId instances are considered equal if their Objects and Behaviours are equal.
The first NetworkBehaviourId to compare.
The second NetworkBehaviourId to compare.
True if the NetworkBehaviourId instances are equal, false otherwise.
Determines whether two NetworkBehaviourId instances are not equal.
Two NetworkBehaviourId instances are considered not equal if their Objects or Behaviours are not equal.
The first NetworkBehaviourId to compare.
The second NetworkBehaviourId to compare.
True if the NetworkBehaviourId instances are not equal, false otherwise.
This static class provides utility methods for working with NetworkBehaviour objects.
This structure holds metadata for a NetworkBehaviour object.
A static field that determines whether to invoke RPC (Remote Procedure Call).
When set to true, RPCs are invoked. When set to false, RPCs are not invoked.
Default value is false.
Retrieves the metadata for a given type.
The type for which to retrieve the metadata.
The metadata for the given type if it exists; otherwise, the default value.
Registers the metadata for a given type.
This method checks if the type has an override for the "ReplicateTo" method and stores this information in the metadata.
If the metadata for the type already exists, this method does nothing.
The type for which to register the metadata.
Retrieves the word count for a given NetworkBehaviour.
If the NetworkBehaviour has a dynamic word count, it is returned.
Otherwise, the static word count for the type of the NetworkBehaviour is returned.
The NetworkBehaviour for which to retrieve the word count.
The word count for the given NetworkBehaviour.
Thrown when the dynamic word count or the static word count is negative.
Checks if a given type has a static word count.
A type has a static word count if it is a subclass of NetworkBehaviour and its word count is non-negative.
The type to check.
True if the type has a static word count, false otherwise.
Thrown when the provided type is not a subclass of NetworkBehaviour.
Thrown when the provided type does not have a weaved attribute.
Retrieves the static word count for a given type.
If the word count for the type has not been computed yet, it is computed and stored.
The type for which to retrieve the static word count.
The static word count for the given type.
Thrown when the provided type is not a subclass of NetworkBehaviour.
Thrown when the provided type does not have a weaved attribute or its word count is negative.
Determines whether the RPC (Remote Procedure Call) invoke delegates should be registered for a given type.
The type for which to check the registration of RPC invoke delegates.
True if the RPC invoke delegates should be registered for the type, false otherwise.
Registers the RPC (Remote Procedure Call) invoke delegates for a given type.
This method is only available when the FUSION_UNITY compilation symbol is defined.
The type for which to register the RPC invoke delegates.
Thrown when the provided type is not a subclass of NetworkBehaviour.
Thrown when the provided type does not have a weaved attribute or its word count is negative.
Tries to get the RPC (Remote Procedure Call) invoke delegate array for a given type.
The type for which to get the RPC invoke delegate array.
When this method returns, contains the RPC invoke delegate array if the type has one; otherwise, null.
true if the type has an RPC invoke delegate array; otherwise, false.
Retrieves the index of a static RPC (Remote Procedure Call) based on its key.
The key of the static RPC.
The index of the static RPC if it exists.
Thrown when the static RPC does not exist.
Tries to get the static RPC (Remote Procedure Call) invoke delegate based on its index.
The index of the static RPC.
When this method returns, contains the static RPC invoke delegate if it exists; otherwise, default.
True if the static RPC invoke delegate exists; otherwise, false.
Logs an error message indicating that the target of a Remote Procedure Call (RPC) payload is too large.
Size of the payload.
The name of the RPC that was attempted.
Logs an error message indicating that the target of a Remote Procedure Call (RPC) is not reachable.
The player reference that is not reachable.
The name of the RPC that was attempted.
Logs an error message indicating that a local simulation is not allowed to send a specific RPC.
The name of the RPC that was attempted.
The network object on which the RPC was attempted.
The sources from which the RPC was attempted.
Logs a warning message indicating that a local targeted RPC was culled.
The player reference for which the RPC was culled.
The name of the method that was culled.
Checks if the NetworkBehaviour object is initialized and throws an exception if it is not.
The NetworkBehaviour object to check.
Thrown when the NetworkBehaviour object is not initialized.
Logs a warning message indicating that a network wrap operation failed.
The type of the value that failed to be wrapped.
The value that failed to be wrapped.
Logs a warning message indicating that a network wrap operation failed for a specific wrapper type.
The type of the value that failed to be wrapped.
The value that failed to be wrapped.
The type that was attempted to be used as a wrapper.
Logs a warning message indicating that a network unwrap operation failed.
The type of the wrapper that failed to be unwrapped.
The wrapper that failed to be unwrapped.
The type that was attempted to be obtained from the unwrap operation.
Initializes a NetworkArray with the values from a source array.
The type of the elements in the NetworkArray and source array.
The NetworkArray to initialize.
The source array from which to copy the values.
The name of the NetworkArray for logging purposes.
If the length of the source array is greater than the length of the NetworkArray, a warning is logged and only the first elements up to the length of the NetworkArray are copied.
Copies the values from a NetworkArray to a destination array.
The type of the elements in the NetworkArray and destination array.
The NetworkArray from which to copy the values.
The destination array to which to copy the values.
If the length of the destination array is not equal to the length of the NetworkArray, a new array of the correct length is created and assigned to the destination array.
Creates a new array that is a clone of the specified array.
The type of the elements in the array.
The array to clone.
A new array that is a clone of the specified array. If the specified array is null, an empty array is returned.
Initializes a NetworkLinkedList with the values from a source array.
The type of the elements in the NetworkLinkedList and source array. Must be unmanaged.
The NetworkLinkedList to initialize.
The source array from which to copy the values.
The name of the NetworkLinkedList for logging purposes.
If the length of the source array is greater than the capacity of the NetworkLinkedList, a warning is logged and only the first elements up to the capacity of the NetworkLinkedList are copied.
Copies the values from a NetworkLinkedList to a destination array.
The type of the elements in the NetworkLinkedList and destination array.
The NetworkLinkedList from which to copy the values.
The destination array to which to copy the values. If the length of the destination array is not equal to the count of the NetworkLinkedList, a new array of the correct length is created and assigned to the destination array.
This method is not meant to be called directly. Calls are injected by the Weaver.
SimulationBehaviour object.
This method is not meant to be called directly. Calls are injected by the Weaver.
SimulationBehaviour object.
This method is not meant to be called directly. Calls are injected by the Weaver.
SimulationBehaviour object.
Initializes a NetworkDictionary with the values from a source dictionary.
The type of the source dictionary. Must implement IDictionary{K, V}.
The type of the keys in the NetworkDictionary and source dictionary. Must be unmanaged.
The type of the values in the NetworkDictionary and source dictionary. Must be unmanaged.
The NetworkDictionary to initialize.
The source dictionary from which to copy the values.
The name of the NetworkDictionary for logging purposes.
If the count of the source dictionary is greater than the capacity of the NetworkDictionary, a warning is logged and only the first elements up to the capacity of the NetworkDictionary are copied.
Copies the values from a NetworkDictionary to a destination dictionary.
The type of the destination dictionary. Must implement IDictionary{K, V} and have a parameterless constructor.
The type of the keys in the NetworkDictionary and destination dictionary. Must be unmanaged.
The type of the values in the NetworkDictionary and destination dictionary. Must be unmanaged.
The NetworkDictionary from which to copy the values.
The destination dictionary to which to copy the values. If the destination dictionary is null, a new dictionary of type D is created.
Wraps a Dictionary in a SerializableDictionary.
The type of the keys in the dictionary. Must be unmanaged.
The type of the values in the dictionary. Must be unmanaged.
The dictionary to wrap.
A SerializableDictionary that wraps the specified dictionary.
A utility structure for initializing NetworkArray and NetworkLinkedList with inline initialization.
The type of the elements in the NetworkArray and NetworkLinkedList.
Implicitly converts an ArrayInitializer to a NetworkArray.
The ArrayInitializer to convert.
A NetworkArray initialized with the values from the ArrayInitializer.
Thrown always as this method is meant to be used only for [Networked] properties inline initialization.
Implicitly converts an ArrayInitializer to a NetworkLinkedList.
The ArrayInitializer to convert.
A NetworkLinkedList initialized with the values from the ArrayInitializer.
Thrown always as this method is meant to be used only for [Networked] properties inline initialization.
A utility structure for initializing NetworkDictionary with inline initialization.
The type of the keys in the NetworkDictionary.
The type of the values in the NetworkDictionary.
Implicitly converts a DictionaryInitializer to a NetworkDictionary.
The DictionaryInitializer to convert.
A NetworkDictionary initialized with the values from the DictionaryInitializer.
Thrown always as this method is meant to be used only for [Networked] properties inline initialization.
A component for synchronizing the Animator controller state from the State Authority to network proxies.
Requires a Unity Animator component, and a component.
NOTE: Animator Root Motion is not compatible with re-simulation and prediction.
Gets the dynamic word count for the NetworkMecanimAnimator.
The dynamic word count, which is the maximum of the current total words and the runtime counts, if the application is playing.
Thrown when this property is accessed outside of playing.
The Animator being synced. If unset, will attempt to find one on this GameObject.
The number of words allocated per snapshot for serialization of the Animator. (One Word is 32 bits, or 4 bytes).
The source of the State which is applied in Render.
Flags controlling which Mecanim data will be synced.
States found in the current AnimatorController, converted to hashes.
Triggers found in the current AnimatorController, converted to hashes.
Queues a SetTrigger() call for the associated Animator on the State Authority. Call this instead of Animator.SetTrigger() for the State Authority to ensure that triggers are captured.
On State Authority, this call will defer the SetTrigger() pass-through to the Animator until FixedUpdateNetwork() is called,
where all queued triggers will be executed (this is to ensure tick agreement between server and clients).
Trigger hash to set
Will call Animator.SetTrigger() immediately on the InputAuthority. If false, SetTrigger() will not be called on the Input Authority at all
and Animator.SetTrigger() should be called explicitly as needed.
Queues a SetTrigger() call for the associated Animator on the State Authority. Call this instead of Animator.SetTrigger() for the State Authority to ensure that triggers are captured.
On State Authority, this call will defer the SetTrigger() pass-through to the Animator until FixedUpdateNetwork() is called,
where all queued triggers will be executed (this is to ensure tick agreement between server and clients).
Trigger name to set
Will call Animator.SetTrigger() immediately on the InputAuthority. If false, SetTrigger() will not be called on the Input Authority at all
and Animator.SetTrigger() should be called explicitly as needed.
Base class for a Fusion aware Behaviour (derived from UnityEngine.MonoBehavour).
Objects derived from this object can be associated with a and .
If a parent is found, this component will also be associated with that network entity.
Gets a value indicating whether this instance can receive render callbacks.
true if this instance can receive render callbacks; otherwise, false.
This property checks the current flags of the instance against various conditions to determine if it can receive render callbacks.
Gets a value indicating whether this instance can receive simulation callbacks.
true if this instance can receive simulation callbacks; otherwise, false.
This property checks the current flags of the instance against various conditions to determine if it can receive simulation callbacks.
The this component is associated with.
The this component is associated with.
Fusion FixedUpdate timing callback.
Post simulation frame rendering callback. Runs after all simulations have finished. Use in place of Unity's Update when Fusion is handling Physics.
This is intentionally private; sub classes can create their own overload
without worrying about matching visibility etc.
calls will be weaved in.
String representation of this object for debugging purposes.
The builder to append to.
Attribute for specifying which and this will execute in.
Can be used to limit execution to only Host, Server or Client peers, or to only execute on Resimulation or Forward ticks.
Usage:
[SimulationBehaviour(Stages = SimulationStages.Forward, Modes = SimulationModes.Server | SimulationModes.Host)]
Flag for which stages of the simulation loop this component will execute this script.
Flag for which indicated peers in will execute this script.
Flag for which topologies this script will execute in
Provides a scope for a SimulationBehaviourUpdater.BehaviourList, incrementing its lock count on creation and decrementing it on disposal.
If the lock count reaches zero on disposal, all pending removals in the list are performed.
Dispose unmanaged resources.
Represents statistics related to the execution of a SimulationBehaviour.
Gets or sets the buffer for tracking the execution time of FixedUpdate over time.
Gets or sets the buffer for tracking the number of FixedUpdate invocations over time.
Gets or sets the buffer for tracking the execution time of Render over time.
Gets or sets the buffer for tracking the number of Render invocations over time.
The default behaviour interfaces
Add to any Transform, or its associated child Transforms to automatically synchronize
TRSP (Position/Rotation/Scale/Parent).
Enables synchronization of LocalScale.
Enables synchronization of transform.parent.
NOTE: Parent GameObjects must have a derived component to be a valid parent,
parent must belong to a different than this Object.
Determines if parent changes should automatically call ,
and assign the parent as the override. Default is true, as you typically will want
player interest in this object to reflect player interest in the nested parent object. For example,
if a player is carrying an nested Object, players should only see that carried Object if they see the player.
Additionally, AOI works in world space, and NetworkTransform operates in local space, so any AOI position values of
nested Objects will ALWAYS be invalid, so nested Objects should always have their AOI Override set to a non-nested Object.
Automatically sets the Area Of Interest Override for this NetworkObject to the parent NetworkObject.
Disable interpolation on State Authority in Shared Mode. You should disable interpolation if your controller code moves an object inside of Update()
rather than FixedUpdateNetwork().
Set the transform position and rotation to the indicated values, and network the Teleport event.
This will suspend interpolation between the previous tick state and the current tick state in Render(),
on this peer and all remote peers.
Manually set the used as the AreaOfInterestOverride.
NetworkObject to use as the AreaOfInterestOverride.
Implement this interface on a implementation to indicate it can be teleported.
Teleports to the indicated values, and network the Teleport event.
Base class for spatial (Position/Rotation/Scale/Parent) synchronization component, such as .
Provides the base logic for render interpolation, parenting synchronization, and teleport, that can be used in components derived from this class.
The main is at the root of the
and it will be used for area of interest operations and parenting of the .
The networked data of this .
A reference to the networked data of this .
Manually set the used as the AreaOfInterestOverride.
NetworkObject to use as the AreaOfInterestOverride.
The default Teleport implementation for derived classes.
Default handling for setting a 's parent using a NetworkBehaviourId value.
Recursively attempts to find nested parent NetworkObject, and if found assigns that NetworkObject as the AreaOfInterestOverride.
Only pass a NetworkTRSP derived class that is on the same Transform as its associated ,
as AreaOfInterestOverride is only applicable when is true..
The direct parent of the
Default Render handling for derived classes.
Data structure storing spatial (Position/Rotation/Scale/Parent) synchronization data for spatial synchronization components, and its subclass .
Special NetworkBehaviourId value, used as a flag to tell the parent is a non-networked object
Networked properties word count for the base
The actual size for the networked properties in bytes
Offset to point at the position values on the data buffer
Id of a NetworkBehaviour on the parent of the component's transform.
Position relevant for the spatial synchronization component (can be used to either store a local position or a world position, depending on the component)
Rotation relevant for the spatial synchronization component (can be used to either store a local rotation or a world rotation, depending on the component)
Scale relevant for the spatial synchronization component
Key used to differentiate between several teleports
Id of a behaviour used as the reference point for this component during area of interest operations
The behaviour should be a derived class, that is on the same Transform as its associated
Tools to replace GetComponent variants that respects nested objects.
These are used to find components of a NetworkedObjects without also finding components that belong to parent or child NetworkedObjects.
Ensures that a component of type T exists on the root object of the provided transform.
If a component of type T does not exist, it is added.
The search for the root object stops if a component of type TStopOn is found.
The type of component to ensure exists on the root object.
The type of component that stops the search for the root object.
The transform to start the search from.
The component of type T on the root object. Returns null if no root object is found.
Find T on supplied transform or any parent. Unlike GetComponentInParent, GameObjects do not need to be active to be found.
Returns all T found between the child transform and its root. Order in List from child to parent, with the root/parent most being last.
Finds the first component of type T in the children of the provided transform, stopping the search if a component of type TStopOn is found.
The type of component to find.
The type of component that stops the search.
The transform to start the search from.
Whether to include inactive game objects in the search.
The first component of type T found. Returns null if no component is found.
Same as GetComponentInParent, but will always include inactive objects in search.
Will also stop recursing up the hierarchy when the StopOnT is found.
Finds the first component of type T in the parents of the provided transform, stopping the search if a component of type TStopOn is found.
The type of component to find.
The type of component that stops the search.
The transform to start the search from.
The first component of type T found in the parents. Returns null if no component is found or a component of type TStopOn is found.
Finds components of type T on supplied transform, and every parent above that node, inclusively stopping on node StopT component.
Same as GetComponentsInChildren, but will not recurse into children with component of the StopT type.
Same as GetComponentsInChildren, but will not recurse into children with any component of the types in the stopOn array.
Same as GetComponentsInChildren, but will not recurse into children with component of the StopT type.
Cast found components to this type. Typically Component, but any other class/interface will work as long as they are assignable from SearchT.
Find components of this class or interface type.
When this component is found, no further recursing will be performed on that node.
Find All instances of Component type in a scene. Attempts to respect the hierarchy of the scene objects to produce a more deterministic order.
This is a slower operation, and does produce garbage collection.
Find All instances of Component type in a scene. Attempts to respect the hierarchy of the scene objects to produce a more deterministic order.
This is a slower operation which should not be run every update.
The type being searched for.
Scene to search.
Supplied list that will be populated by this find.
Whether results should include inactive components.
Find All instances of Component type in a scene. Attempts to respect the hierarchy of the scene objects to produce a more deterministic order.
This is a slow operation, and does produce garbage collection.
The type being searched for.
Casts all found objects to this type, and returns collection of this type. Objects that fail cast are excluded.
Scene to search.
Whether results should include inactive components.
Find All instances of Component type in a scene. Attempts to respect the hierarchy of the scene objects to produce a more deterministic order.
This is a slower operation and should not be run every update.
Type being searched for.
Type to cast found objects to.
Scene to search.
Supplied list that will be filled with found objects.
Whether results should include inactive components.
A dynamic heap for allocating and tracking unmanaged objects.
Mark an object with
Pointer Object to mark
Type of object
Pointer to object
Free up an object
Heap to free from
Pointer to object
Thrown if is not a tracked object
Collect garbage delegate
Collect garbage
Dynamic heap to collect from
Dynamic roots
Dynamic roots length
Ignore this field when scanning for pointers.
Dynamic heap instance.
Create a dynamic heap instance.
Types to allocate.
Finalizes an instance of the class.
Free a pointer.
Pointer to free.
Allocate a pointer.
Size to allocate.
Pointer to allocated memory.
Allocate a pointer array.
Length of array.
Type of array.
Pointer to allocated memory.
Allocate an array of pointers.
Length of array.
Type of array.
Pointer to allocated memory.
Allocate a tracked pointer.
Signal if the pointer is a root.
Type of pointer.
Pointer to allocated memory.
Allocate a tracked pointer array.
Length of array.
Signal if the pointer is a root.
Type of array.
Pointer to allocated memory.
Allocate a tracked array of pointers.
Length of array.
Signal if the pointer is a root.
Type of array.
Pointer to allocated memory.
Call this to batch-optimize any object-changes notified through
ssBVHNode.refit_ObjectChanged(..). For example, in a game-loop,
call this once per frame.
Call this when you wish to update an object. This does not update straight away, but marks it for update when Optimize() is called
initializes a BVH with a given nodeAdaptor, and object list.
SplitNode is called when a node has too many objects in it, and needs to be split into two nodes.
BVH
The list of objects in the node
Details regarding a shape intersection.
It does not carry information about the intersection happening or not.
Contact point.
Vector that described the plane of smallest penetration between the shapes.
Penetration along the normal plane.
Checks if a sphere in the local space of an AABB intersects with it.
The extents of the AABB in the positive direction of each axis.
The center of the sphere in the local space of the AABB.
The radius of the sphere.
True if there is intersection. False otherwise.
Checks if a sphere in the local space of an AABB intersects with it and outputs contact data (also in local space).
The extents of the AABB in the positive direction of each axis.
The center of the sphere in the local space of the AABB.
The radius of the sphere.
Contact data in the local space of the AABB. Default if there is no intersection.
True if there is intersection. False otherwise.
Container class to provide the necessary info to draw nodes from the BVH
Get the node Bounds
Get the node depth on the BVH
Get the BVH max depth
Container class to provide the necessary information to draw a hitbox collider
The of the collider.
The box extends of the collider
Used on of types: Box
The offset of the collider.
The radius of the collider.
Used on of types: Sphere and Capsule.
The height for capsule colliders.
Represents the top center position of the capsule collider.
Represents the bottom center position of the capsule collider.
The local to world matrix of the collider.
Provide access to iterate over the lag compensation system components and give the necessary information to draw them.
Iterate over to get the hitbox snapshots draw data. Iterate the received hitbox snapshot draw data to get all the colliders draw info for that snapshot.
Iterate over to get the BVH node draw data.
Method to draw capsules out of simple shapes.
The top capsule end position
The bottom capsule end posistion
The capsule radius
Provide a way to iterate over the and
return the container for each snapshot on the buffer.
Returns an enumerator that iterates through the .
Provide a way to iterate over the and return
the for each collider on the snapshot.
Returns an enumerator that iterates through the of this container.
Provide a way to iterate over BVH and return a for each node.
Returns an enumerator that iterates through the .
Queries can hit either fusion's custom or Unity's standard Physx/Box2D colliders.
Used when a raycast does not hit anything. Not used on overlaps.
is a Fusion .
is a Unity PhysX Collider.
is a Unity Box2D Collider.
LagCompensated Extension methods
Sorts all in ascending order of distance
from to the point.
List containing hits to be sorted.
Used as reference point to compute distance from hit points.
If are null.
Sorts all in ascending order of .
List containing hits to be sorted.
If are null.
HitboxBuffer will store all snapshots of the colliders into a circular buffer
HitboxContainer represents 1 snapshot of all containers in a given Tick
Pre-processing delegate for queries.
The query to be performed.
The root candidates to be used for the query.
The indices of the colliders that have been processed.
Represents an Axis-Aligned Bounding Box (AABB).
Represents the center of the AABB.
Represents the extents (half-widths) of the AABB.
Represents the minimum point (lower corner) of the AABB.
Represents the maximum point (upper corner) of the AABB.
Constructs an AABB from a Unity Bounds object.
The Unity Bounds object to construct the AABB from.
Constructs an AABB from a center point and extents.
The center point of the AABB.
The extents (half-widths) of the AABB.
Query parameters for position rotation query
Represents the base parameters for the query.
Represents the hitbox to be queried.
Create a new .
Parameters to be used
The hitbox to be queried
Class that represents a box overlap query. Used to query against the API.
The box query center.
The box query extents.
The box query rotation.
Create a new with the given .
The parameters to be used when creating the query.
Create a new with the given . The result colliders arrays
can be provided to avoid allocation.
The parameters to be used when creating the query.
Array to write the results of the PhysX query if used.
Array to write the results of the Box2D query if used.
Check if the given overlaps with this query.
The bounds to check.
True if the bounds overlaps with this query, false otherwise.
Base parameters needed to execute a box overlap query
Represents the base parameters for the query.
Represents the center of the box for the overlap query.
Represents the extents of the box for the overlap query.
Represents the rotation of the box for the overlap query.
Represents the capacity for the cached PhysX and Box2D static hits.
Create a new
Parameters to be used
The query center
The query extents
The query rotation
Capacity for the cached PhysX and Box2D static hits.
Base class for all Lag Compensation queries
Represents the interaction type of the query with triggers.
Represents the options for the hit detection of the query.
Represents the layer mask to selectively ignore colliders when performing the query.
Represents the player who initiated the query.
Represents the simulation tick at which the query was initiated.
Represents the user arguments for the query.
Represents the interpolation factor between the current and next simulation tick.
Represents the simulation tick to which the query is performed.
Represents the delegate to be called for pre-processing before the query is performed.
Initializes a new instance of the Query class using the provided QueryParams.
The QueryParams to use for initializing the Query.
Checks if the provided bounds should be included in the query.
The bounds to check.
True if the bounds should be included in the query, false otherwise.
Base parameters needed to execute a query.
Represents the options for the hit detection of the query.
Represents the interaction type of the query with triggers.
Represents the layer mask to selectively ignore colliders when performing the query.
Represents the player who initiated the query.
Represents the simulation tick at which the query was initiated.
Represents the simulation tick to which the query is performed.
Represents the interpolation factor between the current and next simulation tick.
Represents the delegate to be called for pre-processing before the query is performed.
Represents the user arguments for the query.
Class that represents a raycast all query. Used to query against the API.
Create a new with the given .
The parameters to be used when creating the query.
Create a new with the given . The result colliders arrays
can be provided to avoid allocation.
The parameters to be used when creating the query.
Array to write the results of the PhysX query if used.
Array to write the results of the Box2D query if used.
Class that represents a raycast query. Used to query against the API.
Represents the direction of the raycast for the query.
Represents the origin point of the raycast for the query.
Represents the maximum length of the raycast for the query.
Create a new with the given
The parameters to be used when creating the query.
Check if the provided bounds should be included in the query.
The bounds to check.
True if the bounds should be included in the query, false otherwise.
Base parameters needed to execute a raycast query
Represents the base parameters for the raycast query.
Represents the origin point of the raycast for the query.
Represents the direction of the raycast for the query.
Represents the maximum length of the raycast for the query.
Represents the capacity for the cached PhysX and Box2D static hits.
Create a new
Parameters to be used
The raycast origin
The raycast direction
The raycast max length
Capacity for the cached PhysX and Box2D static hits.
Class that represents a sphere overlap query. Used to query against the API.
Represents the center of the sphere for the overlap query.
Represents the radius of the sphere for the overlap query.
Create a new with the given .
The parameters to be used when creating the query.
Create a new with the given .
The parameters to be used when creating the query.
Array to write the results of the PhysX query if used.
Array to write the results of the Box2D query if used.
Check if the given intersects with the sphere overlap query.
The bounds to check against.
True if the bounds intersects with the sphere overlap query, false otherwise.
Base parameters needed to execute a sphere overlap query
Represents the base parameters for the sphere overlap query.
Represents the center of the sphere for the overlap query.
Represents the radius of the sphere for the overlap query.
Represents the capacity for the cached PhysX and Box2D static hits.
Create a new .
Parameters to be used
The query center
The query radius
Capacity for the cached PhysX and Box2D static hits.
Defines the collision geometry type of a .
[Future Use] to represent a disabled .
Geometry is a box, fill in Extents and (optional) Offset.
Geometry is a sphere, fill in Radius and (optional) Offset.
Geometry is a capsule, fill in capsule Radius, capsule Height and (optional) Offset.
Represents a single lag-compensated collider.
Multiple component instances can be added anywhere in the hierarchy of a which includes a .
The collision geometry type for this .
When is set to , this defines the local-space geometry for narrow-phase checks.
When is set to , this defines the local-space geometry for narrow-phase checks.
When is set to , this defines the local-space geometry for narrow-phase checks.
When is set to , this defines the local-space geometry for narrow-phase checks.
This 's local-space offset from its GameObject position.
Reference to the top-level component for this .
The index of this hitbox in the array on .
The value is set by the root when initializing the nested hitboxes with .
Mask to access the state of this hitbox on the root.
Get or set the state of this Hitbox.
If a hitbox or its HitboxRoot are not active, it will not be hit by lag-compensated queries.
Index assigned to the collider of this hitbox on the lag-compensated snapshots.
World-space position (includes Offset) of this .
Color used when drawing gizmos for this hitbox.
Set a layer mask for this gameobject. This method caches the layer mask.
Draws this hitbox gizmo on Unity editor.
Draw the gizmos.
Entry point for lag compensated queries, which
maintains a history buffer, and provides lag compensated raycast and overlap methods.
Singleton instance is accessible through the property Runner.LagCompensation.
Usage - Call any of the following methods:
HitboxManager.Raycast()
HitboxManager.RaycastAll()
HitboxManager.PositionRotation()
HitboxManager.OverlapSphere()
These methods use the history buffer to perform a query against a state consistent with how the indicated perceived them locally.
Debug data from Broadphase BVH (tree depth).
Debug data from Broadphase BVH (total nodes count).
Debug data from lag compensation history (registered count).
Debug data used to draw the BVH nodes and the lag compensation history.
Performs a lag-compensated raycast query against all registered hitboxes.
If the or flag is indicated, query will also include static colliders,
Unity colliders are recommended for static geometry, rather than Hitboxes.
Raycast origin, in world-space
Raycast direction, in world-space
Raycast length
Player who "owns" this raycast. Used by the server to find the exact hitbox snapshots to check against.
Raycast results will be filled in here.
Only objects with matching layers will be checked against.
Opt-in flags to compute with sub-tick accuracy () and/or to include PhysX () or Box2D ().
Trigger interaction behavior when also querying PhysX.
Delegate to pre-process HitboxRoots found in the broad-phase resolution of the query.
Roots removed from the list will not be processed any further.
Roots that remain on the candidates collection will be normally processed and fitting colliders will be evaluated in
the query narrow-phase resolution.
Hitbox collider indices added to the processed set will be evaluated in the narrow-phase regardless of further root
processing steps (e.g. layer mask match).
True if something is hit
Performs a lag-compensated raycast query against all registered hitboxes.
If the or flag is indicated, query will also include static colliders,
Unity colliders are recommended for static geometry, rather than Hitboxes.
Raycast origin, in world-space
Raycast direction, in world-space
Raycast length
Simulation tick number to use as the time reference for the lag compensation (use this for server AI, and similar).
Simulation tick number to use as the time reference for the lag compensation.
If provided, must be combined with the parameter for interpolation between and .
If is included on , this query will be resolved against hitbox colliders interpolated between the specified ticks.
Otherwise, only one of the two ticks will be considered, according to the rounded value of .
Interpolation value when querying between and .
If is included on , this query will be resolved against hitbox colliders interpolated between the specified ticks.
Otherwise, only one of the two ticks will be considered, according to the rounded alpha value.
Raycast results will be filled in here.
Only objects with matching layers will be checked against.
Opt-in flags to compute with sub-tick accuracy () and/or to include PhysX () or Box2D ().
Trigger interaction behavior when also querying PhysX.
Delegate to pre-process HitboxRoots found in the broad-phase resolution of the query.
Roots removed from the list will not be processed any further.
Roots that remain on the candidates collection will be normally processed and fitting colliders will be evaluated in
the query narrow-phase resolution.
Hitbox collider indices added to the processed set will be evaluated in the narrow-phase regardless of further root
processing steps (e.g. layer mask match).
True if something is hit
Performs a lag-compensated raycast query against all registered hitboxes.
If the or flag is indicated, query will also include static colliders,
Unity colliders are recommended for static geometry, rather than Hitboxes.
Important: results are NOT sorted by distance.
Raycast origin, in world-space
Raycast direction, in world-space
Raycast length
Player who "owns" this raycast. Used by the server to find the exact hitbox snapshots to check against.
List to be filled with hits (both hitboxes and/or static colliders, if included).
Only objects with matching layers will be checked against.
Opt-in flags to compute with sub-tick accuracy () and/or to include PhysX () or Box2D ().
Clear list of hits before filling with new ones (defaults to true).
Trigger interaction behavior when also querying PhysX.
Delegate to pre-process HitboxRoots found in the broad-phase resolution of the query.
Roots removed from the list will not be processed any further.
Roots that remain on the candidates collection will be normally processed and fitting colliders will be evaluated in
the query narrow-phase resolution.
Hitbox collider indices added to the processed set will be evaluated in the narrow-phase regardless of further root
processing steps (e.g. layer mask match).
total number of hits
Performs a lag-compensated raycast query against all registered hitboxes.
If the or flag is indicated, query will also include static colliders,
Unity colliders are recommended for static geometry, rather than Hitboxes.
Important: results are NOT sorted by distance.
Raycast origin, in world-space
Raycast direction, in world-space
Raycast length
Simulation tick number to use as the time reference for the lag compensation (use this for server AI, and similar).
Simulation tick number to use as the time reference for the lag compensation.
If provided, must be combined with the parameter for interpolation between and .
If is included on , this query will be resolved against hitbox colliders interpolated between the specified ticks.
Otherwise, only one of the two ticks will be considered, according to the rounded value of .
Interpolation value when querying between and .
If is included on , this query will be resolved against hitbox colliders interpolated between the specified ticks.
Otherwise, only one of the two ticks will be considered, according to the rounded alpha value.
List to be filled with hits (both hitboxes and/or static colliders, if included).
Only objects with matching layers will be checked against.
Opt-in flags to compute with sub-tick accuracy () and/or to include PhysX () or Box2D ().
Clear list of hits before filling with new ones (defaults to true).
Trigger interaction behavior when also querying PhysX.
Delegate to pre-process HitboxRoots found in the broad-phase resolution of the query.
Roots removed from the list will not be processed any further.
Roots that remain on the candidates collection will be normally processed and fitting colliders will be evaluated in
the query narrow-phase resolution.
Hitbox collider indices added to the processed set will be evaluated in the narrow-phase regardless of further root
processing steps (e.g. layer mask match).
total number of hits
Performs a lag-compensated overlap sphere query against all registered hitboxes.
If the or flag is indicated, query will also include static colliders,
Unity colliders are recommended for static geometry, rather than Hitboxes.
Sphere center, in world-space
Sphere radius
Player who "owns" this overlap. Used by the server to find the exact hitbox snapshots to check against.
List to be filled with hits (both hitboxes and/or static colliders, if included).
Only objects with matching layers will be checked against.
Opt-in flags to compute with sub-tick accuracy () and/or to include PhysX () or Box2D ().
Clear list of hits before filling with new ones (defaults to true).
Trigger interaction behavior when also querying PhysX.
Delegate to pre-process HitboxRoots found in the broad-phase resolution of the query.
Roots removed from the list will not be processed any further.
Roots that remain on the candidates collection will be normally processed and fitting colliders will be evaluated in
the query narrow-phase resolution.
Hitbox collider indices added to the processed set will be evaluated in the narrow-phase regardless of further root
processing steps (e.g. layer mask match).
total number of hits
Performs a lag-compensated overlap sphere query against all registered hitboxes.
If the or flag is indicated, query will also include static colliders,
Unity colliders are recommended for static geometry, rather than Hitboxes.
Sphere center, in world-space
Sphere radius
The tick to be queried
Simulation tick number to use as the time reference for the lag compensation.
If provided, must be combined with the parameter for interpolation between and .
If is included on , this query will be resolved against hitbox colliders interpolated between the specified ticks.
Otherwise, only one of the two ticks will be considered, according to the rounded value of .
Interpolation value when querying between and .
If is included on , this query will be resolved against hitbox colliders interpolated between the specified ticks.
Otherwise, only one of the two ticks will be considered, according to the rounded alpha value.
List to be filled with hits (both hitboxes and/or static colliders, if included).
Only objects with matching layers will be checked against.
Opt-in flags to compute with sub-tick accuracy () and/or to include PhysX () or Box2D ().
Clear list of hits before filling with new ones (defaults to true).
Trigger interaction behavior when also querying PhysX.
Delegate to pre-process HitboxRoots found in the broad-phase resolution of the query.
Roots removed from the list will not be processed any further.
Roots that remain on the candidates collection will be normally processed and fitting colliders will be evaluated in
the query narrow-phase resolution.
Hitbox collider indices added to the processed set will be evaluated in the narrow-phase regardless of further root
processing steps (e.g. layer mask match).
total number of hits
Performs a lag-compensated box overlap query against all registered hitboxes.
If the or flag is indicated, query will also include static colliders,
Unity colliders are recommended for static geometry, rather than Hitboxes.
Center of the box in world space.
Half of the size of the box in each dimension.
Rotation of the box.
Player who "owns" this overlap. Used by the server to find the exact hitbox snapshots to check against.
List to be filled with hits (both hitboxes and/or static colliders, if included).
Only objects with matching layers will be checked against.
Opt-in flags to compute with sub-tick accuracy () and/or to include PhysX () or Box2D ().
Clear list of hits before filling with new ones (defaults to true).
Trigger interaction behavior when also querying PhysX.
Delegate to pre-process HitboxRoots found in the broad-phase resolution of the query.
Roots removed from the list will not be processed any further.
Roots that remain on the candidates collection will be normally processed and fitting colliders will be evaluated in
the query narrow-phase resolution.
Hitbox collider indices added to the processed set will be evaluated in the narrow-phase regardless of further root
processing steps (e.g. layer mask match).
The total number of hits found.
Performs a lag-compensated box overlap query against all registered hitboxes.
If the or flag is indicated, query will also include static colliders,
Unity colliders are recommended for static geometry, rather than Hitboxes.
Center of the box in world space.
Half of the size of the box in each dimension.
Rotation of the box.
The exact tick to be queried
Simulation tick number to use as the time reference for the lag compensation.
If provided, must be combined with the parameter for interpolation between and .
If is included on , this query will be resolved against hitbox colliders interpolated between the specified ticks.
Otherwise, only one of the two ticks will be considered, according to the rounded value of .
Interpolation value when querying between and .
If is included on , this query will be resolved against hitbox colliders interpolated between the specified ticks.
Otherwise, only one of the two ticks will be considered, according to the rounded alpha value.
List to be filled with hits (both hitboxes and/or static colliders, if included).
Only objects with matching layers will be checked against.
Opt-in flags to compute with sub-tick accuracy () and/or to include PhysX () or Box2D ().
Clear list of hits before filling with new ones (defaults to true).
Trigger interaction behavior when also querying PhysX.
Delegate to pre-process HitboxRoots found in the broad-phase resolution of the query.
Roots removed from the list will not be processed any further.
Roots that remain on the candidates collection will be normally processed and fitting colliders will be evaluated in
the query narrow-phase resolution.
Hitbox collider indices added to the processed set will be evaluated in the narrow-phase regardless of further root
processing steps (e.g. layer mask match).
The total number of hits found.
Performs a lag-compensated query for a specific Hitbox position and rotation.
The target hitbox to be queried in the past
The tick to be queried
Simulation tick number to use as the time reference for the lag compensation.
If provided, must be combined with the parameter for interpolation between and .
If is requested, the query will return the hitbox state interpolated between the specified ticks.
Otherwise, only one of the two ticks will be considered, according to the rounded value of .
Interpolation value when querying between and .
If is requested, the query will return the hitbox state interpolated between the specified ticks.
Otherwise, only one of the two ticks will be considered, according to the rounded alpha value.
Will be filled with the hitbox position at the time of the tick
Will be filled with the hitbox rotation at the time of the tick
If the query should interpolate between ticks to reflect exactly what was seen on the client.
Performs a lag-compensated query for a specific Hitbox position and rotation.
The target hitbox to be queried in the past
Player who "owns" this overlap. Used by the server to find the exact hitbox snapshots to check against.
Will be filled with the hitbox position at the time of the tick
Will be filled with the hitbox rotation at the time of the tick
If the query should interpolate between ticks to reflect exactly what was seen on the client.
Get the closest hit from a list of .
The closest found.
Performs a lag-compensated raycast query against all registered hitboxes.
If the or flag is indicated, query will also include static colliders,
Unity colliders are recommended for static geometry, rather than Hitboxes.
The query containing all necessary information.
Raycast results will be filled in here.
The total number of hits found.
Performs a lag-compensated raycast query against all registered hitboxes.
If the or flag is indicated, query will also include static colliders,
Unity colliders are recommended for static geometry, rather than Hitboxes.
The query containing all necessary information.
List to be filled with hits (both hitboxes and/or static colliders, if included).
Clear list of hits before filling with new ones (defaults to true).
The total number of hits found.
Performs a lag-compensated sphere overlap query against all registered hitboxes.
If the or flag is indicated, query will also include static colliders,
Unity colliders are recommended for static geometry, rather than Hitboxes.
The query containing all necessary information.
List to be filled with hits (both hitboxes and/or static colliders, if included).
Clear list of hits before filling with new ones (defaults to true).
The total number of hits found.
Performs a lag-compensated box overlap query against all registered hitboxes.
If the or flag is indicated, query will also include static colliders,
Unity colliders are recommended for static geometry, rather than Hitboxes.
The query containing all necessary information.
List to be filled with hits (both hitboxes and/or static colliders, if included).
Clear list of hits before filling with new ones (defaults to true).
The total number of hits found.
Gets the tick and alpha interpolate values for a player.
The player reference.
The tick value from which to interpolate.
The tick value to which to interpolate.
The interpolation alpha value.
Internal use. Inserts (new ones) and updates all registered hitboxes into lag compensation history.
Register new hitboxes and updates existing ones on the Server.
Used internally to write the benchmark results.
Per-query options for lag compensation (both raycast and overlap).
Default, no extra options.
Add this to include checks against PhysX colliders.
Add this to include checks against Box2D colliders. If PhysX flag is set, it will be used instead.
Subtick accuracy query (exactly like seen by player).
If the objects which the player performing the query
(if specified) has input authority over should be ignored by the query.
Settings for lag compensation history.
Indicates if a instance should be added when the is initialized.
Hitbox snapshot history length in milliseconds.
Hitbox capacity per snapshot.
The size of the cached static colliders (PhysX or Box2D) array of the default Lag Compensation Queries.
Broadphase BVH node expansion factor (default 20%) for leaf nodes, so updates are not too frequent.
Optional: tries to optimize broadphase BVH every update. May be removed in the future.
Defines a lag compensated query hit result.
Hit object source (PhysX or Fusion Hitboxes).
The Unity Game Object that was hit. Its data is not lag compensated.
This is either the 's or the 's gameObject,
depending on the object hit being a lag-compensated Hitbox or a regular Unity collider, respectively.
Surface normal (if requested) of the hit, at the lag compensated time.
Point of impact of the hit, at the lag compensated time.
The hitbox collider position on the snapshot.
The hitbox collider rotation on the snapshot.
Distance (if requested) to hit, at the lag compensated time.
Fusion's . Null in case the hit was on PhysX or Box2D.
PhysX collider hit. Null in case hit is a Fusion or a Box2D hit.
Box2D collider hit. Null in case hit is a Fusion or a PhysX hit.
Auxiliary field used when sorting hits in a collection.
Creates a structure from the information on a Unity .
The used as source.
The built LagCompensatedHit structure.
Creates a structure from the information on a Unity .
The used as source.
The built LagCompensatedHit structure.
Creates a structure from the information on a .
The used as source.
The built LagCompensatedHit structure.
Root group container. Manages registering/unregistering hitboxes with the group, and defines the broadphase geometry for the group.
Broadphase is the initial rough query used by raycasts/overlaps/etc to find potential hit candidates,
which are then used in the final narrowphase query.
Set of configuration options for a Hitbox Root behaviour.
If the collection of hitboxes under a given root should be re-initialized before the Root is registered
in a hitbox snapshot. If disabled, the hitboxes will be used as configured in edit-time.
If Hitboxes on inactive Game Objects should be registered under this root upon initialization.
Set of configuration flags that replicate the behaviour as it was before the flag options were added.
Ser of configuration flags with the default behaviour, suitable for most use-cases.
Get or set the state of this HitboxRoot.
For a hitbox to be hit by lag-compensated queries, both it and its HitboxRoot must be active.
The max number of hitboxes allowed under the same root.
Set of configuration options for this Hitbox Root behaviour.
Check the API documentation for more details on what each flag represents.
The radius of the broadphase bounding sphere for this group.
Used by to insert/update lag compensated NetworkObjects into its BVH (bounding volume hierarchy) data structure.
Be sure this radius encompasses all children components (including their full ranges of animation motion).
We plan to offer an option to dynamically compute the bounding volume, but the performance trade of will still favor a hand-crafted radius.
Broadphase is the initial rough query used by raycasts/overlaps/etc to find potential hit candidates,
which are then used in the final narrowphase query.
Local-space offset of the broadphase bounding sphere from its transform position.
Adjust the and until the sphere gizmo (shown in the Unity Scene window)
encompasses all children components (including their full ranges of animation motion).
Broadphase is the initial rough query used by raycasts/overlaps/etc to find potential hit candidates,
which are then used in the final narrowphase query.
Color used when drawing gizmos for this hitbox.
All Hitbox instances in hierarchy. Auto-filled at Spawned.
Reference to associated hitbox manager (from which lag compensated queries can be performed).
If this is in interest for the local player.
on draw gizmos.
Draws the gizmos for the
Finds child components, and adds them to the collection.
Sets to a rough value which encompasses all in their current positions.
Sets the state of a Hitbox instance under this root.
Both the hitbox and its root must be active in order for it to be hit by lag-compensated queries.
A hitbox instance under the hierarchy of this root.
If the hitbox should be activated or deactivated.
If the of the is outside the valid range.
In Debug configuration, if the is not part of this root.
Checks the state of a Hitbox instance under this root.
Both the hitbox and its root must be active in order for it to be hit by lag-compensated queries.
A hitbox instance under the hierarchy of this root.
True if the is part of this root and is active.
If the of the is outside the valid range.
In Debug configuration, if the is not part of this root.
A Networked fusion type for degrees. This can be used with the , in RPCs, or in structs.
Size of this struct in bytes.
Clamps the current value to the supplied min-max range.
Returns the smaller of two supplied angles.
Returns the larger of two supplied angles.
Lerps between two angle values.
Returns a the value, clamped to the min-max range.
Less than operator for Angle struct.
First Angle instance.
Second Angle instance.
True if the value of the first Angle instance is less than the value of the second Angle instance, otherwise false.
Less than or equal to operator for Angle struct.
First Angle instance.
Second Angle instance.
True if the value of the first Angle instance is less than or equal to the value of the second Angle instance, otherwise false.
Greater than operator for Angle struct.
First Angle instance.
Second Angle instance.
True if the value of the first Angle instance is greater than the value of the second Angle instance, otherwise false.
Greater than or equal to operator for Angle struct.
First Angle instance.
Second Angle instance.
True if the value of the first Angle instance is greater than or equal to the value of the second Angle instance, otherwise false.
Equality operator for Angle struct.
First Angle instance.
Second Angle instance.
True if the value of the first Angle instance is equal to the value of the second Angle instance, otherwise false.
Inequality operator for Angle struct.
First Angle instance.
Second Angle instance.
True if the value of the first Angle instance is not equal to the value of the second Angle instance, otherwise false.
Checks equality with another Angle.
Other Angle.
Equality result.
Checks equality with an object.
Object to compare.
Equality result.
Gets the hash code.
Hash code.
Addition operator for Angle struct.
First Angle instance.
Second Angle instance.
A new Angle instance that is the sum of the first and second Angle instances, wrapped around at 360 degrees if necessary.
Subtraction operator for Angle struct.
First Angle instance.
Second Angle instance.
A new Angle instance that is the difference of the first and second Angle instances, wrapped around at 360 degrees if necessary.
Converts Angle to float.
Angle instance.
Float representation of the Angle.
Converts Angle to double.
Angle instance.
Double representation of the Angle.
Converts double to Angle.
Double value.
Angle instance with the value of the double.
Converts float to Angle.
Float value.
Angle instance with the value of the float.
Converts int to Angle.
Integer value.
Angle instance with the value of the integer.
String representation of the Angle.
Base class for all Fusion assets.
Alternative base class to Unity's MonoBehaviour.
This allows for components that work both in Unity, as well as the Photon relays.
Wrapper for Unity's GameObject.AddComponent()
Wrapper for Unity's GameObject.TryGetComponent()
Wrapper for Unity's GameObject.GetComponentInChildren()
Wrapper for Unity's GameObject.Destroy()
Get the string to dump to the log.
The string builder to append to.
Represents a compressed float value for network transmission.
Encoded value of the float.
Implicit conversion from float to FloatCompressed.
The float value to convert.
A new FloatCompressed instance with the compressed value of the float.
Implicit conversion from FloatCompressed to float.
The FloatCompressed instance to convert.
The decompressed float value of the FloatCompressed instance.
Checks if the current FloatCompressed instance is equal to the other FloatCompressed instance.
The other FloatCompressed instance to compare with the current FloatCompressed instance.
True if the values of both FloatCompressed instances are equal, otherwise false.
Checks if the provided object is a FloatCompressed instance and if it's equal to the current FloatCompressed instance.
The object to compare with the current FloatCompressed instance.
True if the provided object is a FloatCompressed instance and it's equal to the current FloatCompressed instance, otherwise false.
Returns the hash code for the current FloatCompressed instance.
A hash code for the current FloatCompressed instance.
Equality operator for FloatCompressed struct.
First FloatCompressed instance.
Second FloatCompressed instance.
True if the value of the first FloatCompressed instance is equal to the value of the second FloatCompressed instance, otherwise false.
Inequality operator for FloatCompressed struct.
First FloatCompressed instance.
Second FloatCompressed instance.
True if the value of the first FloatCompressed instance is not equal to the value of the second FloatCompressed instance, otherwise false.
Represents a compressed Vector2 value for network transmission.
Encoded value of the x component.
Encoded value of the y component.
Gets or sets the x component.
Gets or sets the y component.
Implicit conversion from Vector2 to Vector2Compressed.
The Vector2 value to convert.
A new Vector2Compressed instance with the compressed value of the Vector2.
Implicit conversion from Vector2Compressed to Vector2.
The Vector2Compressed instance to convert.
The decompressed Vector2 value of the Vector2Compressed instance.
Checks if the current Vector2Compressed instance is equal to the other Vector2Compressed instance.
The other Vector2Compressed instance to compare with the current Vector2Compressed instance.
True if the values of both Vector2Compressed instances are equal, otherwise false.
Checks if the provided object is a Vector2Compressed instance and if it's equal to the current Vector2Compressed instance.
The object to compare with the current Vector2Compressed instance.
True if the provided object is a Vector2Compressed instance and it's equal to the current Vector2Compressed instance, otherwise false.
Returns the hash code for the current Vector2Compressed instance.
A hash code for the current Vector2Compressed instance.
Equality operator for Vector2Compressed struct.
First Vector2Compressed instance.
Second Vector2Compressed instance.
True if the value of the first Vector2Compressed instance is equal to the value of the second Vector2Compressed instance, otherwise false.
Inequality operator for Vector2Compressed struct.
First Vector2Compressed instance.
Second Vector2Compressed instance.
True if the value of the first Vector2Compressed instance is not equal to the value of the second Vector2Compressed instance, otherwise false.
Represents a compressed Vector3 value for network transmission.
Encoded value of the x component.
Encoded value of the y component.
Encoded value of the z component.
Gets or sets the x component.
Gets or sets the y component.
Gets or sets the z component.
Implicit conversion from Vector3 to Vector3Compressed.
The Vector3 value to convert.
A new Vector3Compressed instance with the compressed value of the Vector3.
Implicit conversion from Vector3Compressed to Vector3.
The Vector3Compressed instance to convert.
The decompressed Vector3 value of the Vector3Compressed instance.
Implicit conversion from Vector2 to Vector3Compressed.
The Vector2 value to convert.
A new Vector3Compressed instance with the compressed value of the Vector2.
Implicit conversion from Vector3Compressed to Vector2.
The Vector3Compressed instance to convert.
The decompressed Vector2 value of the Vector3Compressed instance.
Checks if the current Vector3Compressed instance is equal to the other Vector3Compressed instance.
The other Vector3Compressed instance to compare with the current Vector3Compressed instance.
True if the values of both Vector3Compressed instances are equal, otherwise false.
Checks if the provided object is a Vector3Compressed instance and if it's equal to the current Vector3Compressed instance.
The object to compare with the current Vector3Compressed instance.
True if the provided object is a Vector3Compressed instance and it's equal to the current Vector3Compressed instance, otherwise false.
Returns the hash code for the current Vector3Compressed instance.
A hash code for the current Vector3Compressed instance.
Equality operator for Vector3Compressed struct.
First Vector3Compressed instance.
Second Vector3Compressed instance.
True if the value of the first Vector3Compressed instance is equal to the value of the second Vector3Compressed instance, otherwise false.
Inequality operator for Vector3Compressed struct.
First Vector3Compressed instance.
Second Vector3Compressed instance.
True if the value of the first Vector3Compressed instance is not equal to the value of the second Vector3Compressed instance, otherwise false.
Represents a compressed Vector4 value for network transmission.
Encoded value of the x component.
Encoded value of the y component.
Encoded value of the z component.
Encoded value of the w component.
Gets or sets the x component.
Gets or sets the y component.
Gets or sets the z component.
Gets or sets the w component.
Implicit conversion from Vector4 to Vector4Compressed.
The Vector4 value to convert.
A new Vector4Compressed instance with the compressed value of the Vector4.
Implicit conversion from Vector4Compressed to Vector4.
The Vector4Compressed instance to convert.
The decompressed Vector4 value of the Vector4Compressed instance.
Checks if the current Vector4Compressed instance is equal to the other Vector4Compressed instance.
The other Vector4Compressed instance to compare with the current Vector4Compressed instance.
True if the values of both Vector4Compressed instances are equal, otherwise false.
Checks if the provided object is a Vector4Compressed instance and if it's equal to the current Vector4Compressed instance.
The object to compare with the current Vector4Compressed instance.
True if the provided object is a Vector4Compressed instance and it's equal to the current Vector4Compressed instance, otherwise false.
Returns the hash code for the current Vector4Compressed instance.
A hash code for the current Vector4Compressed instance.
Equality operator for Vector4Compressed struct.
First Vector4Compressed instance.
Second Vector4Compressed instance.
True if the value of the first Vector4Compressed instance is equal to the value of the second Vector4Compressed instance, otherwise false.
Inequality operator for Vector4Compressed struct.
First Vector4Compressed instance.
Second Vector4Compressed instance.
True if the value of the first Vector4Compressed instance is not equal to the value of the second Vector4Compressed instance, otherwise false.
Represents a compressed Quaternion value for network transmission.
Encoded value of the x component.
Encoded value of the y component.
Encoded value of the z component.
Encoded value of the w component.
Gets or sets the x component.
Gets or sets the y component.
Gets or sets the z component.
Gets or sets the w component.
Implicit conversion from Quaternion to QuaternionCompressed.
The Quaternion value to convert.
A new QuaternionCompressed instance with the compressed value of the Quaternion.
Implicit conversion from QuaternionCompressed to Quaternion.
The QuaternionCompressed instance to convert.
The decompressed Quaternion value of the QuaternionCompressed instance.
Checks if the current QuaternionCompressed instance is equal to the other QuaternionCompressed instance.
The other QuaternionCompressed instance to compare with the current QuaternionCompressed instance.
True if the values of both QuaternionCompressed instances are equal, otherwise false.
Checks if the provided object is a QuaternionCompressed instance and if it's equal to the current QuaternionCompressed instance.
The object to compare with the current QuaternionCompressed instance.
True if the provided object is a QuaternionCompressed instance and it's equal to the current QuaternionCompressed instance, otherwise false.
Returns the hash code for the current QuaternionCompressed instance.
A hash code for the current QuaternionCompressed instance.
Equality operator for QuaternionCompressed struct.
First QuaternionCompressed instance.
Second QuaternionCompressed instance.
True if the value of the first QuaternionCompressed instance is equal to the value of the second QuaternionCompressed instance, otherwise false.
Inequality operator for QuaternionCompressed struct.
First QuaternionCompressed instance.
Second QuaternionCompressed instance.
True if the value of the first QuaternionCompressed instance is not equal to the value of the second QuaternionCompressed instance, otherwise false.
Defines the type of the current connection with the Remote Peer,
either the Server or a Client
No connection is currently active
Connection was accomplished using the Photon Relay Services
Connection was accomplished directly with the remote peer
A fixed size array that can be used in structs.
Enumerator for the FixedArray struct.
Gets the current element in the collection.
Initializes a new instance of the Enumerator struct.
The FixedArray instance to enumerate.
Advances the enumerator to the next element of the collection.
True if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.
Sets the enumerator to its initial position, which is before the first element in the collection.
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
The fixed size of the array.
Indexer of array elements.
NetworkArray constructor.
Allocates a new array and copies values from this array. For a non-alloc alternative use .
Adds each value to the supplied List. This does not clear the list, so values will be appended to the existing list.
Copies values to the supplied array.
The array to copy values to. Must not be null.
If true, this method will throw an error if the supplied array is smaller than this . If false, will only copy as many elements as the target array can hold.
Returns a string that represents the current object.
Returns an enumerator that iterates through the FixedArray.
Sets all elements in the array to their default value.
Copies a range of elements from a source array into the FixedArray.
The source array from which to copy elements. Must not be null.
The zero-based index in the source array at which copying begins.
The number of elements to copy from the source array.
Thrown when the provided source array is null.
Thrown when the number of elements to copy is greater than the length of the FixedArray.
Thrown when the sum of sourceOffset and sourceCount is greater than the length of the source array.
Copies a range of elements from a source list into the FixedArray.
The source list from which to copy elements. Must not be null.
The zero-based index in the source list at which copying begins.
The number of elements to copy from the source list.
Thrown when the provided source list is null.
Thrown when the number of elements to copy is greater than the length of the FixedArray.
Thrown when the sum of sourceOffset and sourceCount is greater than the length of the source list.
Returns the elements of this array as a string, with value separated by \n characters. Specifically for use in the Unity inspector.
This is private and only is found by NetworkBehaviourEditor using reflection, so do not rename this method.
Helper methods for FixedArray.
Creates a FixedArray from a sequence of fields.
Reference to the first field in the sequence.
Reference to the last field in the sequence.
A new FixedArray instance with the values from the sequence of fields.
Creates a FixedArray with a specified length.
Reference to the first field in the array.
The length of the array.
A new FixedArray instance with the specified length.
Creates a FixedArray with a specified length and adapts the type of the elements.
Reference to the first field in the array.
The length of the array.
A new FixedArray instance with the specified length and adapted type of elements.
Returns the index of the first occurrence of a value in the FixedArray.
The FixedArray to search.
The value to locate in the FixedArray.
The zero-based index of the first occurrence of elem within the entire FixedArray, if found; otherwise, -1.
Interface for fixed storage types.
Provides utility methods for fixed storage types.
Gets the word count of a fixed storage type.
The type of the fixed storage.
The word count of the fixed storage type.
A FixedStorage that can hold up to 2 words.
The size of the FixedStorage in bytes.
The data of the FixedStorage.
A FixedStorage that can hold up to 4 words.
The size of the FixedStorage in bytes.
The data of the FixedStorage.
A FixedStorage that can hold up to 8 words.
The size of the FixedStorage in bytes.
The data of the FixedStorage.
A FixedStorage that can hold up to 16 words.
The size of the FixedStorage in bytes.
The data of the FixedStorage.
A FixedStorage that can hold up to 32 words.
The size of the FixedStorage in bytes.
The data of the FixedStorage.
A FixedStorage that can hold up to 64 words.
The size of the FixedStorage in bytes.
The data of the FixedStorage.
A FixedStorage that can hold up to 128 words.
The size of the FixedStorage in bytes.
The data of the FixedStorage.
A FixedStorage that can hold up to 256 words.
The size of the FixedStorage in bytes.
The data of the FixedStorage.
A FixedStorage that can hold up to 512 words.
The size of the FixedStorage in bytes.
The data of the FixedStorage.
Provides utility methods for compressing and decompressing float values.
Default accuracy for float compression and decompression.
Compresses a float value.
The float value to compress.
The accuracy to use for compression. Defaults to DEFAULT_ACCURACY.
The compressed float value.
Decompresses a compressed float value.
The compressed float value to decompress.
The accuracy to use for decompression. Defaults to DEFAULT_ACCURACY.
The decompressed float value.
This may only be deterministic on 64 bit systems.
String to hash
Initial hash value
Hash code
Defines an asynchronous operation.
Gets a value indicating whether the operation is done.
Occurs when the operation is completed.
Gets the exception information if an error occurred during the operation.
Defines a coroutine.
Defines the interface for reading and writing elements in a byte array.
The type of the elements.
Reads an element from the specified index in the byte array.
The byte array.
The index of the element.
The element at the specified index.
Writes an element to the specified index in the byte array.
The byte array.
The index at which to write the element.
The element to write.
Gets the word count of an element.
The word count of an element.
Reads a reference to an element from the specified index in the byte array.
The byte array.
The index of the element.
A reference to the element at the specified index.
Calculate the hash code of an element.
Flag interface for custom NetworkInput structs.
A set of parameters that tune the interpolated correction of prediction error on transform data.
A factor with dimension of 1/s (Hz) that works as a lower limit for how much
of the accumulated prediction error is corrected every frame.
This factor affects both the position and the rotation correction.
Suggested values are greater than zero and smaller than MaxRate.
E.g.: MinRate = 3, rendering delta time = (1/60)s: at least 5% (3 * 1/60) of the accumulated error
will be corrected on this rendered frame.
This threshold might not be respected if the resultant correction magnitude is
below the PosMinCorrection
or above the PosTeleportDistance, for the position error,
or above the RotTeleportRadians, for the rotation error.
A factor with dimension of 1/s (Hz) that works as a upper limit for how much
of the accumulated prediction error is corrected every frame.
This factor affects both the position and the rotation correction.
Suggested values are greater than MinRate
and smaller than half of a target rendering rate.
E.g.: MaxRate = 15, rendering delta time = (1/60)s: at maximum 25% (15 * 1/60) of the accumulated error
will be corrected on this rendered frame.
This threshold might not be respected if the resultant correction magnitude is
below the PosMinCorrection or
above the PosTeleportDistance, for the position error,
or above the RotTeleportRadians, for the rotation error.
The reference for the magnitude of the accumulated position error, in meters,
at which the position error will be corrected at the MinRate.
Suggested values are greater than PosMinCorrection
and smaller than PosBlendEnd.
In other words, if the magnitude of the accumulated error is equal to or smaller than this threshold,
it will be corrected at the MinRate.
If, instead, the magnitude is between this threshold and PosBlendEnd,
the error is corrected at a rate between MinRate
and MaxRate, proportionally.
If it is equal to or greater than PosBlendEnd,
it will be corrected at the MaxRate.
Note: as the factor is expressed in distance units (meters), it might need to be scaled
proportionally to the overall scale of objects in the scene and speeds at which they move,
which are factors that affect the expected magnitude of prediction errors.
The reference for the magnitude of the accumulated position error, in meters,
at which the position error will be corrected at the MaxRate.
Suggested values are greater than PosBlendStart
and smaller than PosTeleportDistance.
In other words, if the magnitude of the accumulated error is equal to or greater than this threshold,
it will be corrected at the MaxRate.
If, instead, the magnitude is between PosBlendStart and this threshold,
the error is corrected at a rate between MinRate
and MaxRate, proportionally.
If it is equal to or smaller than PosBlendStart,
it will be corrected at the MinRate.
Note: as the factor is expressed in distance units (meters), it might need to be scaled
proportionally to the overall scale of objects in the scene and speeds at which they move,
which are factors that affect the expected magnitude of prediction errors.
The value, in meters, that represents the minimum magnitude of the accumulated position error
that will be corrected in a single frame, until it is fully corrected.
This setting has priority over the resultant correction rate, i.e. the restriction
will be respected even if it makes the effective correction rate be different than
the one computed according to the min/max rates and start/end blend values.
Suggested values are greater than zero and smaller than PosBlendStart.
Note: as the factor is expressed in distance units (meters), it might need to be scaled
proportionally to the overall scale of objects in the scene and speeds at which they move,
which are factors that affect the expected magnitude of prediction errors.
The value, in meters, that represents the magnitude of the accumulated
position error above which the error will be instantaneously corrected,
effectively teleporting the rendered object to its correct position.
Suggested values are greater than PosBlendEnd.
This setting has priority over the resultant correction rate, i.e. the restriction
will be respected even if it makes the effective correction rate be different than
the one computed according to the min/max rates and start/end blend values.
Note: as the factor is expressed in distance units (meters), it might need to be scaled
proportionally to the overall scale of objects in the scene and speeds at which they move,
which are factors that affect the expected magnitude of prediction errors.
The reference for the magnitude of the accumulated rotation error, in radians,
at which the rotation error will be corrected at the MinRate.
Suggested values are smaller than RotBlendEnd.
In other words, if the magnitude of the accumulated error is equal to or smaller than this threshold,
it will be corrected at the MinRate.
If, instead, the magnitude is between this threshold and RotBlendEnd,
the error is corrected at a rate between MinRate
and MaxRate, proportionally.
If it is equal to or greater than RotBlendEnd,
it will be corrected at the MaxRate.
The reference for the magnitude of the accumulated rotation error, in radians,
at which the rotation error will be corrected at the MaxRate.
Suggested values are greater than RotBlendStart
and smaller than RotTeleportRadians.
In other words, if the magnitude of the accumulated error is equal to or greater than this threshold,
it will be corrected at the MaxRate.
If, instead, the magnitude is between RotBlendStart and this threshold,
the error is corrected at a rate between MinRate
and MaxRate, proportionally.
If it is equal to or smaller than RotBlendStart,
it will be corrected at the MinRate.
The value, in radians, that represents the magnitude of the accumulated
rotation error above which the error will be instantaneously corrected,
effectively teleporting the rendered object to its correct orientation.
Suggested values are greater than RotBlendEnd.
This setting has priority over the resultant correction rate, i.e. the restriction
will be respected even if it makes the effective correction rate be different than
the one computed according to the min/max rates and start/end blend values.
Log Simple Unity
Fusion type for networking arrays.
Maximum capacity is fixed, and is set with the .
Typical Usage:
[Networked, Capacity(4)]
NetworkArray<float> syncedArray => default;
Optional usage (for NetworkBehaviours ONLY - this is not legal in INetworkStructs):
[Networked, Capacity(4)]
NetworkArray<int> syncedArray { get; } = MakeInitializer(new int[] { 1, 2, 3, 4 });
Usage for modifying data:
array.Set(123);
array[0] = 456;
T can be a primitive, or an INetworkStruct.
Enumerator for NetworkArray.
Gets the current element in the collection.
Gets the current element in the collection.
Initializes a new instance of the Enumerator with the specified NetworkArray.
The NetworkArray to enumerate.
Advances the enumerator to the next element of the collection.
true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.
Sets the enumerator to its initial position, which is before the first element in the collection.
Releases all resources used by the Enumerator.
The fixed size of the array.
Indexer of array elements.
NetworkArray constructor.
Returns a NetworkArrayReadOnly view of this array.
Returns the array value at supplied index.
Sets the array value at the supplied index.
This method is exposed with an extension method to filter
types to unmanaged ones only. This is not exhaustive,
as wrapped types are likely to pass this.
Index to get.
Value at index.
Allocates a new array and copies values from this array. For a non-alloc alternative use .
Adds each value to the supplied List. This does not clear the list, so values will be appended to the existing list.
Copies values to the supplied array.
NetworkArray to copy to.
Thrown if the supplied array is smaller than this .
Copies values to the supplied array.
Array to copy to.
If true, this method will throw an error if the supplied array is smaller than this . If false, will only copy as many elements as the target array can hold.
Returns a string that represents the current object.
Returns an enumerator that iterates through the collection.
Clears the array, setting all values to default.
Copies a range of elements from a source array into the NetworkArray.
The source array from which to copy elements. Must not be null.
The zero-based index in the source array at which copying begins.
The number of elements to copy from the source array.
Thrown when the provided source array is null.
Thrown when the number of elements to copy is greater than the length of the NetworkArray.
Thrown when the sum of sourceOffset and sourceCount is greater than the length of the source array.
Copies a range of values from a supplied source list into the NetworkArray.
The source list from which to copy elements.
The zero-based index in the source list at which copying begins.
The number of elements to copy from the source list.
Thrown when the provided source list is null.
Thrown when the number of elements to copy is greater than the length of the NetworkArray.
Thrown when the sum of sourceOffset and sourceCount is greater than the length of the source list.
Returns the elements of this array as a string, with value separated by \n characters. Specifically for use in the Unity inspector.
This is private and only is found by NetworkBehaviourEditor using reflection, so do not rename this method.
Returns a NetworkArrayReadOnly view of this array.
NetworkArray to convert.
NetworkArrayReadOnly view of this array.
Provides extension methods for the NetworkArray class.
Finds the index of the first occurrence of a specified element in the NetworkArray.
The NetworkArray to search.
The element to locate in the NetworkArray.
The zero-based index of the first occurrence of elem within the entire NetworkArray, if found; otherwise, -1.
Returns a reference to the element at a specified position in the NetworkArray.
The NetworkArray to search.
The zero-based index of the element to get a reference for.
A reference to the element at the specified position in the NetworkArray.
Defines the interface for a networked array.
Gets or sets the element at the specified index.
The zero-based index of the element to get or set.
Provides a read-only view of a network array.
The type of the elements.
The fixed size of the array.
Indexer of array elements.
NetworkArrayReadOnly constructor.
Represents a boolean value that can be networked.
Initializes a new instance of the NetworkBool struct with the specified value.
The boolean value.
Determines whether the specified NetworkBool is equal to the current NetworkBool.
The NetworkBool to compare with the current NetworkBool.
true if the specified NetworkBool is equal to the current NetworkBool; otherwise, false.
Returns a string that represents the current NetworkBool.
A string that represents the current NetworkBool.
Determines whether the specified object is equal to the current NetworkBool.
The object to compare with the current NetworkBool.
true if the specified object is equal to the current NetworkBool; otherwise, false.
Serves as the default hash function.
A hash code for the current NetworkBool.
Defines an implicit conversion of a NetworkBool to a bool.
The NetworkBool to convert.
Defines an implicit conversion of a bool to a NetworkBool.
The bool to convert.
Represents a set of buttons that can be networked.
Gets the bits representing the state of the buttons.
Initializes a new instance of the NetworkButtons struct with the specified buttons state.
The integer representing the state of the buttons.
Checks if the button at the specified index is set.
The index of the button to check.
true if the button is set; otherwise, false.
Sets the button at the specified index to down.
The index of the button to set to down.
Sets the button at the specified index to up.
The index of the button to set to up.
Sets the button at the specified index to the specified state.
The index of the button to set.
The state to set the button to.
Sets all buttons to up.
Sets all buttons to down.
Checks if the button of the specified enum type is set.
The enum type of the button.
The button of type T to check.
true if the button is set; otherwise, false.
Sets the button of the specified enum type to down.
The enum type of the button.
The button of type T to set to down.
Sets the button of the specified enum type to up.
The enum type of the button.
The button of type T to set to up.
Sets the button of the specified enum type to the specified state.
The enum type of the button.
The button of type T to set.
The state to set the button to.
Gets the buttons that were pressed or released since the previous state.
The previous state of the buttons.
A tuple containing the buttons that were pressed and the buttons that were released.
Gets the buttons that were pressed since the previous state.
The previous state of the buttons.
The buttons that were pressed.
Gets the buttons that were released since the previous state.
The previous state of the buttons.
The buttons that were released.
Checks if the button at the specified index was pressed since the previous state.
The previous state of the buttons.
The index of the button to check.
true if the button was pressed; otherwise, false.
Checks if the button at the specified index was released since the previous state.
The previous state of the buttons.
The index of the button to check.
true if the button was released; otherwise, false.
Checks if the button of the specified enum type was pressed since the previous state.
The enum type of the button.
The previous state of the buttons.
The button of type T to check.
true if the button was pressed; otherwise, false.
Checks if the button of the specified enum type was released since the previous state.
The enum type of the button.
The previous state of the buttons.
The button of type T to check.
true if the button was released; otherwise, false.
Determines whether the specified NetworkButtons is equal to the current NetworkButtons.
The NetworkButtons to compare with the current NetworkButtons.
true if the specified NetworkButtons is equal to the current NetworkButtons; otherwise, false.
Determines whether the specified object is equal to the current NetworkButtons.
The object to compare with the current NetworkButtons.
true if the specified object is equal to the current NetworkButtons; otherwise, false.
Serves as the default hash function.
A hash code for the current NetworkButtons.
Fusion type for networking Dictionaries.
Maximum capacity is fixed, and is set with the .
Typical Usage:
[Networked, Capacity(10)]
NetworkDictionary<int, float> syncedDict => default;
Usage for modifying data:
var dict = syncedDict;
dict.Add(5, 123);
dict[5] = 456;
dict.Remove(5);
Key can be a primitive, or an INetworkStruct.
Value can be a primitive, or an INetworkStruct.
Meta word count for NetworkDictionary.
Enumerator for NetworkDictionary.
Move to next entry in dictionary.
Returns true if there is a next entry.
Reset enumerator.
Current key/value pair.
Thrown if enumerator is not valid.
Dispose enumerator.
Current number of key/value entries in the Dictionary.
The maximum number of entries this dictionary may contain.
Key indexer. Gets/Sets value for specified key.
Initializes a new instance of the NetworkDictionary struct with the specified data, capacity, and reader/writers.
The pointer to the data of the dictionary.
The capacity of the dictionary.
The reader/writer for the keys of the dictionary.
The reader/writer for the values of the dictionary.
Converts the current NetworkDictionary to a read-only version.
A new instance of NetworkDictionaryReadOnly with the same data, capacity, and reader/writers as the current NetworkDictionary.
Remove all entries from the Dictionary, and clear backing memory.
Returns true if the Dictionary contains an entry for the given key.
Returns true if the Dictionary contains an entry value which compares as equal to given value.
The value to compare against.
Specify custom IEqualityComparer to be used for compare.
Returns the value for the given key. Will throw an error if the key is not found.
Sets the value for the given key. Will add a new key if the key does not already exist.
Adds a new key value pair to the Dictionary. If the key already exists, will return false.
Attempts to get the value for a given key. If found, returns true.
The key to remove.
Returns value of removed item. Returns default value if key did not exist.
Returns true if key was found.
Remove entry from Dictionary.
The key to remove.
Returns true if key was found.
Removes entry from Dictionary. If successful (key existed), returns true and the value of removed item.
The key to remove.
Returns value of removed item. Returns default value if key did not exist.
Returns true if key was found.
Returns an enumerator that iterates through the NetworkDictionary.
Converts the current NetworkDictionary to a read-only version.
The NetworkDictionary to convert.
A new instance of NetworkDictionaryReadOnly with the same data, capacity, and reader/writers as the current NetworkDictionary.
Defines the interface for a networked dictionary.
Adds an item to the networked dictionary.
The item to add to the dictionary.
A read-only version of .
The type of the key.
The type of the value.
Current number of key/value entries in the Dictionary.
The maximum number of entries this dictionary may contain.
Returns the value for the given key. Will throw an error if the key is not found.
Attempts to get the value for a given key. If found, returns true.
The key to remove.
Returns value of removed item. Returns default value if key did not exist.
Returns true if key was found.
Fusion type for networking LinkedLists.
Maximum capacity is fixed, and is set with the .
Typical Usage:
[Networked, Capacity(10)]
NetworkLinkedList<int> syncedLinkedList => default;
Optional usage (for NetworkBehaviours ONLY - this is not legal in INetworkStructs):
[Networked, Capacity(4)]
NetworkLinkedList<int> syncedLinkedList { get; } = MakeInitializer(new int[] { 1, 2, 3, 4 });
Usage for modifying data:
var list = syncedLinkedList;
list.Add(123);
list[0] = 456;
list.Remove(0);
T can be a primitive, or an INetworkStruct.
Returns the number of words required to store a single element.
Returns the number of words required to store the list metadata.
Enumerator for .
Advances the enumerator to the next element of the .
Returns true if the enumerator advanced to the next element.
Resets the enumerator to its initial position, which is before the first element in the collection.
Gets the current element in the collection.
The current element in the collection.
Thrown when the enumerator is positioned before the first element or after the last element.
Releases all resources used by the .
Returns the current element count.
Returns the max element count.
Element indexer.
Initializes a new instance of the NetworkLinkedList struct with the specified data, capacity, and reader/writer.
The pointer to the data of the list.
The capacity of the list.
The reader/writer for the elements of the list.
Remaps the current NetworkLinkedList to a new memory location.
The pointer to the new memory location.
A new instance of NetworkLinkedList with the same capacity and reader/writer, but mapped to the new memory location.
Removes and clears all list elements.
Returns true if the value already exists in the list.
Returns true if the value already exists in the list.
Sets the value at supplied index.
Returns the value at supplied index.
Returns the index with this value. Returns -1 if not found.
Returns the index of the first occurrence of a value in the NetworkLinkedList.
The value to locate in the NetworkLinkedList. The value can be null for reference types.
An equality comparer to compare values. Must not be null.
The zero-based index of the first occurrence of value within the entire NetworkLinkedList, if found; otherwise, -1.
This method performs a linear search; therefore, this method is an O(n) operation, where n is Capacity.
Removes the first found element with indicated value.
Removes the first found element with indicated value.
Adds a value to the end of the list.
Value to add.
Get the enumerator for the list.
Defines the interface for a networked linked list.
Adds an item to the networked linked list.
The item to add to the linked list.
Read-only version of .
Custom struct type.
Returns the number of words required to store a single element.
Returns the number of words required to store the list metadata.
Returns the current element count.
Returns the max element count.
Element indexer.
Returns true if the value already exists in the list.
Returns true if the value already exists in the list.
Returns the value at supplied index.
Returns the index with this value. Returns -1 if not found.
Returns the index of the first occurrence of a value in the FixedArray.
The value to locate in the FixedArray. The value can be null for reference types.
An equality comparer to compare values. Must not be null.
The zero-based index of the first occurrence of value within the entire FixedArray, if found; otherwise, -1.
This method performs a linear search; therefore, this method is an O(n) operation, where n is Capacity.
PCG32 random generator, 16 bytes in size.
http://www.pcg-random.org
0x1.00000001p-32 aka 0x3df0000000100000
0x1p-32 aka 0x3df0000000000000
0x1.000002p-24 aka 0x33800001
0x1p-24 aka 0x33800000
Returns the same RNG instance.
Generates a random double value within the inclusive range [0, 1].
A random double value between 0 and 1, inclusive.
Generates a random double value within the exclusive range [0, 1).
A random double value between 0 (inclusive) and 1 (exclusive).
Generates a random float value within the inclusive range [0, 1].
A random float value between 0 and 1, inclusive.
Generates a random float value within the exclusive range [0, 1).
A random float value between 0 (inclusive) and 1 (exclusive).
Generates a random integer value within the range of int.MinValue to int.MaxValue.
A random integer value between int.MinValue and int.MaxValue, inclusive.
Generates a random unsigned integer value within the range of 0 to uint.MaxValue.
A random unsigned integer value between 0 and uint.MaxValue, inclusive.
Size of the struct in bytes.
Maximum allowed value
Creates a new instance of with a random seed.
Seed value.
String representation of the RNG state.
Returns a random Double within [minInclusive, maxInclusive] (range is inclusive).
If minInclusive is greater than maxInclusive, then the numbers are automatically swapped.
Returns a random Single within [minInclusive, maxInclusive] (range is inclusive).
If minInclusive is greater than maxInclusive, then the numbers are automatically swapped.
Returns a random Int32 within [minInclusive, maxExclusive) (range is exclusive).
If minInclusive and maxExclusive are equal, then the "exclusive rule" is ignored and minInclusive will be returned.
If minInclusive is greater than maxExclusive, then the numbers are automatically swapped.
Returns a random Int32 within [minInclusive, maxInclusive] (range is inclusive).
If minInclusive is greater than maxInclusive, then the numbers are automatically swapped.
Returns a random UInt32 within [minInclusive, maxExclusive) (range is exclusive).
If minInclusive and maxExclusive are equal, then the "exclusive rule" is ignored and minInclusive will be returned.
If minInclusive is greater than maxExclusive, then the numbers are automatically swapped.
Returns a random UInt32 within [minInclusive, maxInclusive] (range is inclusive).
If minInclusive is greater than maxInclusive, then the numbers are automatically swapped.
Fixed-size UTF32 string. All operations are alloc-free, except for converting to .
Creates a new instance of with the given value.
String value.
Maximum UTF32 string length.
Converts to/from regular UTF16 string. Setter is alloc-free. Use
to get possibly alloc-free conversion.
Number of UTF32 scalars. It is equal or less than or the length
of , because those use UTF16 encoding, which needs two characters to encode
some values.
Returns UTF32 scalar at position. To iterate over characters,
use .
Index to get.
UTF32 scalar at position.
Defines an implicit conversion of a string to a NetworkString.
The string to convert.
A new instance of NetworkString with the same value as the string.
Defines an explicit conversion of a NetworkString to a string.
The NetworkString to convert.
The string value of the NetworkString.
Defines an inequality operator for NetworkString.
The first NetworkString to compare.
The second NetworkString to compare.
true if the NetworkStrings are not equal; otherwise, false.
Defines an inequality operator for a string and a NetworkString.
The string to compare.
The NetworkString to compare.
true if the string and the NetworkString are not equal; otherwise, false.
Defines an inequality operator for a NetworkString and a string.
The NetworkString to compare.
The string to compare.
true if the NetworkString and the string are not equal; otherwise, false.
Defines an equality operator for NetworkString.
The first NetworkString to compare.
The second NetworkString to compare.
true if the NetworkStrings are equal; otherwise, false.
Defines an equality operator for a string and a NetworkString.
The string to compare.
The NetworkString to compare.
true if the string and the NetworkString are equal; otherwise, false.
Defines an equality operator for a NetworkString and a string.
The NetworkString to compare.
The string to compare.
true if the NetworkString and the string are equal; otherwise, false.
Checks if is equivalent and if not converts to UTF16 and
stores the result in .
The string to convert.
False if no conversion was performed, true otherwise.
Converts to UTF32 string and stores it internally.
The string to set.
False if was too long to fit and had to be trimmed.
Returns the index of the first occurrence of a specified character in this instance.
The Unicode character to seek.
The search starting position.
The zero-based index position of value if that character is found, or -1 if it is not.
Returns the index of the first occurrence of a specified character in this instance.
The Unicode character to seek.
The search starting position.
The number of character positions to examine.
The zero-based index position of value if that character is found, or -1 if it is not.
Returns the index of the first occurrence of a specified Unicode code point in this instance.
The Unicode code point to seek.
The search starting position.
The zero-based index position of value if that Unicode code point is found, or -1 if it is not.
Returns the index of the first occurrence of a specified Unicode code point in this instance.
The Unicode code point to seek.
The search starting position.
The number of character positions to examine.
The zero-based index position of value if that Unicode code point is found, or -1 if it is not.
Thrown when the start index is less than zero or greater than the safe length of the string, or when the count is less than zero or the sum of the start index and count is greater than the safe length of the string.
Returns the index of the first occurrence of a specified string in this instance.
The string to seek.
The search starting position.
The zero-based index position of value if that string is found, or -1 if it is not.
Returns the index of the first occurrence of a specified string in this instance.
The string to seek.
The search starting position.
The number of character positions to examine.
The zero-based index position of value if that string is found, or -1 if it is not.
Thrown when the string is null.
Thrown when the start index is less than zero or greater than the safe length of the string, or when the count is less than zero or the sum of the start index and count is greater than the safe length of the string.
Returns the index of the first occurrence of a specified NetworkString in this instance.
The size of the other NetworkString.
The NetworkString to seek.
The search starting position.
The zero-based index position of value if that NetworkString is found, or -1 if it is not.
Returns the index of the first occurrence of a specified NetworkString in this instance.
The size of the other NetworkString.
The NetworkString to seek.
The search starting position.
The number of character positions to examine.
The zero-based index position of value if that NetworkString is found, or -1 if it is not.
Returns the index of the first occurrence of a specified NetworkString in this instance.
The size of the other NetworkString.
The NetworkString to seek.
The search starting position.
The zero-based index position of value if that NetworkString is found, or -1 if it is not.
Returns the index of the first occurrence of a specified NetworkString in this instance.
The size of the other NetworkString.
The NetworkString to seek.
The search starting position.
The number of character positions to examine.
The zero-based index position of value if that NetworkString is found, or -1 if it is not.
Thrown when the start index is less than zero or greater than the safe length of the string, or when the count is less than zero or the sum of the start index and count is greater than the safe length of the string.
Determines whether a specified character is in this instance.
The Unicode character to seek.
true if the value parameter occurs within this string, or if value is the empty string (""); otherwise, false.
Determines whether a specified Unicode code point is in this instance.
The Unicode code point to seek.
true if the value parameter occurs within this string, or if value is the empty string (""); otherwise, false.
Determines whether a specified string is in this instance.
The string to seek.
true if the value parameter occurs within this string, or if value is the empty string (""); otherwise, false.
Determines whether a specified NetworkString is in this instance.
The size of the other NetworkString.
The NetworkString to seek.
true if the value parameter occurs within this string, or if value is the empty string (""); otherwise, false.
Determines whether a specified NetworkString is in this instance.
The size of the other NetworkString.
The NetworkString to seek.
true if the value parameter occurs within this string, or if value is the empty string (""); otherwise, false.
Returns a substring from this instance. The substring starts at a specified character position.
The zero-based starting character position of a substring in this instance.
A new NetworkString that is equivalent to the substring that begins at startIndex in this instance, or NetworkString.Empty if startIndex is equal to the length of this instance.
startIndex is less than zero or greater than the length of this instance.
Returns a substring from this instance. The substring starts at a specified character position and has a specified length.
The zero-based starting character position of a substring in this instance.
The number of characters in the substring.
A new NetworkString that is equivalent to the substring of length length that begins at startIndex in this instance, or NetworkString.Empty if startIndex is equal to the length of this instance and length is zero.
startIndex plus length indicates a position not within this instance, or startIndex or length is less than zero.
Converts all the characters in this NetworkString to lowercase.
A new NetworkString in which all characters in this NetworkString are converted to lowercase.
Converts all the characters in this NetworkString to uppercase.
A new NetworkString in which all characters in this NetworkString are converted to uppercase.
Calculates the length of the equivalent UTF16 string.
The length of the equivalent UTF16 string.
Compares this instance with a specified string.
The string to compare.
A 32-bit signed integer that indicates the comparison result.
Compares this instance with a specified NetworkString.
The NetworkString to compare.
A 32-bit signed integer that indicates the comparison result.
Compares this instance with a specified NetworkString.
The NetworkString to compare.
A 32-bit signed integer that indicates the comparison result.
Compares this instance with a specified NetworkString of a different size.
The size of the other NetworkString.
The NetworkString to compare.
A 32-bit signed integer that indicates the comparison result.
Compares this instance with a specified NetworkString of a different size.
The size of the other NetworkString.
The NetworkString to compare.
A 32-bit signed integer that indicates the comparison result.
Determines whether the current NetworkString is equal to a specified string.
The string to compare with the current NetworkString.
true if the specified string is equal to the current NetworkString; otherwise, false.
Determines whether the current NetworkString is equal to a specified object.
The object to compare with the current NetworkString.
true if the specified object is equal to the current NetworkString; otherwise, false.
Determines whether the current NetworkString is equal to a specified NetworkString.
The NetworkString to compare with the current NetworkString.
true if the specified NetworkString is equal to the current NetworkString; otherwise, false.
Determines whether the current NetworkString is equal to a specified NetworkString.
The NetworkString to compare with the current NetworkString.
true if the specified NetworkString is equal to the current NetworkString; otherwise, false.
Determines whether the current NetworkString is equal to a specified NetworkString of a different size.
The size of the other NetworkString.
The NetworkString to compare with the current NetworkString.
true if the specified NetworkString is equal to the current NetworkString; otherwise, false.
Determines whether the current NetworkString is equal to a specified NetworkString of a different size.
The size of the other NetworkString.
The NetworkString to compare with the current NetworkString.
true if the specified NetworkString is equal to the current NetworkString; otherwise, false.
Assign a new value to this NetworkString.
String value.
Checks if the current NetworkString starts with a specified string.
The string to check.
true if the current NetworkString starts with the specified string; otherwise, false.
Thrown when the string is null.
Checks if the current NetworkString starts with a specified NetworkString of a different size.
The size of the other NetworkString.
The NetworkString to check.
true if the current NetworkString starts with the specified NetworkString; otherwise, false.
Checks if the current NetworkString ends with a specified NetworkString of a different size.
The size of the other NetworkString.
The NetworkString to check.
true if the current NetworkString ends with the specified NetworkString; otherwise, false.
Checks if the current NetworkString ends with a specified string.
The string to check.
true if the current NetworkString ends with the specified string; otherwise, false.
Thrown when the string is null.
Returns the hash code for this NetworkString.
A 32-bit signed integer hash code.
Converts the value of this NetworkString to its equivalent string representation.
A string representation of the value of this NetworkString.
Returns an enumerator that iterates through the NetworkString.
A UTF32Tools.CharEnumerator for the NetworkString.
Provides static methods for NetworkString operations.
Gets the capacity of a NetworkString of a specified size.
The size of the NetworkString.
The capacity of a NetworkString of the specified size.
Represents a Fusion player.
The PlayerRef, in contrast to the player index, is 1-based. The reason is that default(PlayerRef) will return a "null/invalid" player ref struct for convenience. There are automatic cast operators that can cast an int into a PlayerRef.
default(PlayerRef), internally a 0, means NOBODY
PlayerRef, internally 1, is the same as player index 0
PlayerRef, internally 2, is the same as player index 1
Gets an equality comparer that can be used to compare two PlayerRef instances.
The size of the PlayerRef structure in bytes.
A constant representing the raw index value for the master client.
None player
Special master client player ref value of -1
If this player ref is a valid unique player index
Returns true if the index value equals -1 (internal raw value of 0), indicating no player.
Returns true if this PlayerRef indicates the MasterClient rather than a specific Player by Index,
This is a special flag value which has the encoded index value of -2 (internal raw backing value of -1).
This is not a valid PlayerRef value in itself, and no Runner will ever be assigned this value as its LocalPlayer.
It is used by properties like Object.StateAuthority to indicate that the MasterClient has authority
(which ever player that currently is), rather than a specific Player.
Returns the index backing value without modification.
Unlike which returns the backing value - 1.
0=None -1=MasterClient >0=PlayerId
Returns the PlayerRef int as an integer Id value.
-1=None -2=MasterClient >=0=PlayerId
Returns the PlayerRef as an integer Id value.
-1=None -2=MasterClient
Determines whether the specified object is equal to the current object.
The object to compare with the current object.
true if the specified object is equal to the current object; otherwise, false.
Serves as the default hash function.
Returns a string that represents the current object.
Creates a new PlayerRef from the given encoded value.
The encoded value to create the PlayerRef from.
A new PlayerRef that represents the encoded value.
Creates a new PlayerRef from the given index.
The index to create the PlayerRef from.
A new PlayerRef that represents the index.
Determines whether two PlayerRef instances are equal.
The first PlayerRef to compare.
The second PlayerRef to compare.
true if the PlayerRefs are equal; otherwise, false.
Determines whether two PlayerRef instances are not equal.
The first PlayerRef to compare.
The second PlayerRef to compare.
true if the PlayerRefs are not equal; otherwise, false.
Writes the PlayerRef to the provided NetBitBuffer.
The buffer to write to.
The PlayerRef to write.
Writes the PlayerRef to the provided buffer.
The type of the buffer. Must be unmanaged and implement INetBitWriteStream.
The buffer to write to.
The PlayerRef to write.
Reads a PlayerRef from the provided NetBitBuffer.
The buffer to read from.
The PlayerRef read from the buffer.
Determines whether the specified PlayerRef is equal to the current PlayerRef.
The PlayerRef to compare with the current PlayerRef.
true if the specified PlayerRef is equal to the current PlayerRef; otherwise, false.
Provides utility methods for reading and writing data.
Accuracy of floating point values when serialized.
Writes a float value to the provided memory location.
The memory location to write to.
The float value to write.
Reads a float value from the provided memory location.
The memory location to read from.
The float value read from the memory location.
Writes a Vector2 value to the provided memory location.
The memory location to write to.
The Vector2 value to write.
Reads a Vector2 value from the provided memory location.
The memory location to read from.
The Vector2 value read from the memory location.
Writes a Vector3 value to the provided memory location.
The memory location to write to.
The Vector3 value to write.
Reads a Vector3 value from the provided memory location.
The memory location to read from.
The Vector3 value read from the memory location.
Writes a Vector4 value to the provided memory location.
The memory location to write to.
The Vector4 value to write.
Reads a Vector4 value from the provided memory location.
The memory location to read from.
The Vector4 value read from the memory location.
Writes a Quaternion value to the provided memory location.
The memory location to write to.
The Quaternion value to write.
Reads a Quaternion value from the provided memory location.
The memory location to read from.
The Quaternion value read from the memory location.
Writes an empty NetworkBehaviour reference to the provided memory location.
The memory location to write to.
Writes a null NetworkBehaviour reference to the provided memory location.
The memory location to write to.
Writes a NetworkBehaviour reference to the provided memory location.
The memory location to write to.
The NetworkRunner associated with the NetworkBehaviour.
The NetworkBehaviour reference to write.
Reads a NetworkBehaviour reference from the provided memory location.
Null is considered valid (0,1).
The memory location to read from.
The NetworkRunner associated with the NetworkBehaviour.
Out parameter indicating whether the read operation was valid.
The NetworkBehaviour reference read from the memory location.
Provides utility methods for reading and writing data.
Accuracy of floating point values when serialized.
Reads a boolean value from the provided memory location.
The memory location to read from.
The boolean value read from the memory location.
Writes a boolean value to the provided memory location.
The memory location to write to.
The boolean value to write.
Writes a string to the provided memory location in UTF8 format without a hash.
The memory location to write to.
The string to write.
The number of bytes written.
Reads a string from the provided memory location in UTF8 format without a hash.
The memory location to read from.
The string read from the memory location.
The number of bytes read.
Gets the byte count of a string in UTF8 format without a hash.
The string to get the byte count of.
The byte count of the string in UTF8 format.
Writes a string to the provided memory location in UTF32 format without a hash.
The memory location to write to.
The maximum length of the string.
The string to write.
The number of bytes written.
Reads a string from the provided memory location in UTF32 format without a hash.
The memory location to read from.
The maximum length of the string.
The string read from the memory location.
The number of bytes read.
Writes a string to the provided memory location in UTF32 format with a hash.
The memory location to write to.
The maximum length of the string.
The string to write.
A reference to a cache string. This will be updated with the trimmed value of the input string.
The number of bytes written.
Reads a string from the provided memory location in UTF32 format with a hash.
The memory location to read from.
The maximum length of the string.
A reference to a cache string. This will be updated with the read string if it matches the cached hashcode.
The number of bytes read.
Gets the word count of a string with optional caching.
The capacity of the string.
Indicates whether caching is used.
The word count of the string.
Verifies the byte count of a network unwrapped object.
Throws an exception if the actual byte count exceeds the maximum allowed byte count.
The type of the network unwrapped object.
The actual byte count.
The maximum allowed byte count.
The actual byte count if it does not exceed the maximum allowed byte count.
Verifies the byte count of a network wrapped object.
Throws an exception if the actual byte count exceeds the maximum allowed byte count.
The type of the network wrapped object.
The actual byte count.
The maximum allowed byte count.
The actual byte count if it does not exceed the maximum allowed byte count.
Provides utility methods for reflection.
Retrieves a custom attribute of type T from the provided member.
The type of the attribute to retrieve. Must be a subclass of Attribute.
The member to retrieve the attribute from.
Specifies whether to search this member's inheritance chain to find the attributes.
The custom attribute of type T.
Thrown when the provided member does not have an attribute of type T.
Thrown when the provided member has more than one attribute of type T.
Gets the NetworkBehaviourWeavedAttribute for the specified type.
Throws an InvalidOperationException if the type has not been weaved.
The type to get the NetworkBehaviourWeavedAttribute for.
The NetworkBehaviourWeavedAttribute for the specified type.
Thrown when the type has not been weaved.
Gets all assemblies that have been weaved.
An IEnumerable of all weaved assemblies.
Gets all types that are assignable from SimulationBehaviour from all assemblies.
An IEnumerable of all types that are assignable from SimulationBehaviour.
Gets all types that are assignable from SimulationBehaviour from all weaved assemblies.
An IEnumerable of all types that are assignable from SimulationBehaviour in weaved assemblies.
Gets all types that are assignable from NetworkBehaviour from all assemblies.
An IEnumerable of all types that are assignable from NetworkBehaviour.
Gets all types that are assignable from NetworkBehaviour from all weaved assemblies.
An IEnumerable of all types that are assignable from NetworkBehaviour in weaved assemblies.
Gets all types that have the WeaverGeneratedAttribute from all weaved assemblies.
An IEnumerable of all types that have the WeaverGeneratedAttribute in weaved assemblies.
A circular buffer.
Normally, you push to the back and pop from the front.
When it's full, PushBack will remove from the front and PushFront will remove from the back.
Returns a new instance.
Returns a new instance.
The number of items in the buffer.
The maximum number of items that can be in the buffer.
True if the buffer contains no items.
True if the buffer contains the maximum number of items.
Indexed access to items in the buffer.
Indexes follow insertion order, i.e. this[0] returns the front item and this[Count - 1] returns the rear item.
The front item in the buffer.
The back item in the buffer.
Inserts an item at the back of the buffer.
Inserts an item at the front of the buffer.
Removes and returns the item at the back of the buffer.
Removes and returns the item at the front of the buffer.
Removes all items from the buffer.
Returns an ArraySegment pair, where both segments and the items within them follow insertion order.
Does not copy.
Returns a new array with the buffer's items in insertion order.
Returns an enumerator that can iterate the buffer.
Converts index into the corresponding index in _buffer.
Increments the provided index variable, wrapping around if necessary.
Decrements the provided index variable, wrapping around if necessary.
Scene reference struct.
Can be used to reference a scene by index or by path.
The size of the SceneRef structure in bytes.
A constant representing the flag for addressable scenes.
The raw value of the SceneRef. This can represent either an index or a path hash, depending on the flag.
None scene
If this scene index is valid
Returns true if this scene ref is an index.
Returns lower 32 bits as an index.
Gets the path hash of the SceneRef.
Thrown when the SceneRef is an index, not a path.
Checks if the SceneRef corresponds to a specific path.
The path to check.
true if the SceneRef corresponds to the path; otherwise, false.
Creates a SceneRef from an index.
The index to create the SceneRef from.
A SceneRef that represents the index.
Thrown when the index is less than 0 or equal to int.MaxValue.
Creates a scene ref from a path. The most common use case for this method is when using Unity's addressable scenes.
The path is hashed (31 bit), so on rare occasion there may be a hash collision. In such case
consider renaming a scene or construct your own hash and use .
To check if a scene ref is was created for a specific path, use .
The path to create the SceneRef from.
A SceneRef that represents the path.
Creates a SceneRef from a raw value.
The raw value to create the SceneRef from.
A SceneRef that represents the raw value.
Determines whether the specified object is equal to the current SceneRef.
The object to compare with the current SceneRef.
true if the specified object is equal to the current SceneRef; otherwise, false.
Determines whether the specified SceneRef is equal to the current SceneRef.
The SceneRef to compare with the current SceneRef.
true if the specified SceneRef is equal to the current SceneRef; otherwise, false.
Serves as the default hash function.
A hash code for the current SceneRef.
Returns a string that represents the current SceneRef.
A string that represents the current SceneRef.
Returns a string that represents the current SceneRef, with optional formatting.
If true, the string will be enclosed in brackets.
If true, the string will be prefixed with "Scene:".
A string that represents the current SceneRef, formatted according to the provided parameters.
Returns true if the values are equal.
SceneRef a
SceneRef b
true if the values are equal; otherwise, false.
Returns true if the values are not equal.
SceneRef a
SceneRef b
true if the values are not equal; otherwise, false.
A serializable dictionary.
Creates a new serializable dictionary.
The type of the dictionary key.
The type of the dictionary value.
A new serializable dictionary.
A serializable dictionary.
The type of the dictionary key.
The type of the dictionary value.
This class is not thread-safe.
The property path for the items in the SerializableDictionary.
The property path for the key in the Entry structure.
Wraps an existing Dictionary into a SerializableDictionary.
The Dictionary to be wrapped.
A new SerializableDictionary that wraps the provided Dictionary.
Gets or sets the value associated with the specified key.
The key of the value to get or set.
The value associated with the specified key. If the specified key is not found, a get operation throws a KeyNotFoundException, and a set operation creates a new element with the specified key.
Gets the number of key/value pairs contained in the SerializableDictionary.
Gets a value indicating whether the SerializableDictionary is read-only. This value is always false.
Adds the specified key and value to the SerializableDictionary.
The key of the element to add.
The value of the element to add.
Removes all keys and values from the SerializableDictionary.
Determines whether the SerializableDictionary contains the specified key.
The key to locate in the SerializableDictionary.
true if the SerializableDictionary contains an element with the specified key; otherwise, false.
Removes the value with the specified key from the SerializableDictionary.
The key of the element to remove.
true if the element is successfully found and removed; otherwise, false. This method returns false if key is not found in the SerializableDictionary.
Gets the value associated with the specified key.
The key of the value to get.
When this method returns, contains the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized.
true if the SerializableDictionary contains an element with the specified key; otherwise, false.
Gets a collection containing the keys in the SerializableDictionary.
Gets a collection containing the values in the SerializableDictionary.
Returns an enumerator that iterates through the SerializableDictionary.
A Dictionary{TKey,TValue}.Enumerator structure for the SerializableDictionary.
Resets the SerializableDictionary, clearing its internal dictionary.
Stores the SerializableDictionary's data into an array for serialization.
This includes handling duplicates and null keys.
A tick is a 32-bit integer that represents a frame number.
Provides a mechanism for comparing two Tick objects.
Compares two Tick objects and returns a value indicating whether one is less than, equal to, or greater than the other.
The first Tick object to compare.
The second Tick object to compare.
A signed integer that indicates the relative values of x and y.
Provides a mechanism for comparing two Tick objects for equality.
Determines whether the specified Tick objects are equal.
The first Tick object to compare.
The second Tick object to compare.
true if the specified Tick objects are equal; otherwise, false.
Serves as a hash function for a Tick object.
The Tick object for which to get a hash code.
A hash code for the specified Tick object.
The size of the Tick structure in bytes.
The alignment of the Tick structure in bytes.
The raw value of the Tick. This represents a frame number.
Returns the next Tick, incremented by a specified value.
The value to increment the Tick by.
A new Tick that represents the current Tick incremented by the specified value.
Determines whether the specified Tick is equal to the current Tick.
The Tick to compare with the current Tick.
true if the specified Tick is equal to the current Tick; otherwise, false.
Compares the current Tick with another Tick.
A Tick to compare with this Tick.
A value that indicates the relative order of the objects being compared.
Determines whether the specified object is equal to the current Tick.
The object to compare with the current Tick.
true if the specified object is equal to the current Tick; otherwise, false.
Serves as the default hash function.
A hash code for the current Tick.
String representation of the Tick.
Determines whether the first specified Tick is greater than the second specified Tick.
Determines whether the first specified Tick is greater than or equal to the second specified Tick.
Determines whether the first specified Tick is less than the second specified Tick.
Determines whether the first specified Tick is less than or equal to the second specified Tick.
Determines whether the first specified Tick is equal to the second specified Tick.
Determines whether the first specified Tick is not equal to the second specified Tick.
Converts an integer to a Tick.
The integer to convert.
A Tick that represents the specified integer. If the integer is less than 0, the Tick's raw value is set to 0.
Converts a Tick to an integer.
The Tick to convert.
An integer that represents the raw value of the specified Tick.
Converts a Tick to a boolean.
The Tick to convert.
true if the Tick's raw value is greater than 0; otherwise, false.
A tick accumulator.
Gets the number of pending ticks in the TickAccumulator.
Gets the remaining time in the TickAccumulator.
Gets a value indicating whether the TickAccumulator is running.
Gets or sets the time scale of the TickAccumulator.
Thrown when the value is less than or equal to 0.
Calculates the alpha value based on the given step.
The step value used to calculate the alpha.
The calculated alpha value.
Adds a specified number of ticks to the TickAccumulator.
The number of ticks to add.
Adds a specified amount of time to the TickAccumulator, incrementing the tick count as necessary.
The amount of time to add.
The time step value.
The maximum number of ticks to add. If this value is reached, the remaining time is set to 0.
Stops the TickAccumulator from accumulating ticks.
Starts the TickAccumulator, allowing it to accumulate ticks.
Consumes a tick from the TickAccumulator.
When this method returns, contains a boolean indicating whether the consumed tick was the last one.
true if a tick was successfully consumed; otherwise, false.
Starts a new TickAccumulator.
A new TickAccumulator.
A tick rate is a collection of tick rates.
Represents a selection of tick rates for client and server.
The tick rate for the client.
The index of the server's tick rate in the available tick rates.
The index of the client's send tick rate in the available tick rates.
The index of the server's send tick rate in the available tick rates.
Represents a resolved tick rate.
The tick rate is resolved by the client and server tick rates.
The size of the Resolved structure in bytes.
The size of the Resolved structure in words.
The tick rate for the client.
The send tick rate for the client.
The tick rate for the server.
The send tick rate for the server.
Gets the delta time for the server tick rate.
Gets the delta time for the server send rate.
Gets the stride of the server tick rate relative to the client tick rate.
Gets the delta time for the client tick rate.
Gets the delta time for the client send rate.
Gets the stride of the client tick rate. This is always 1.
Enumerates the possible results of validating a tick rate selection.
The tick rate selection is valid.
An error occurred during validation.
The tick rate selection was not found.
The tick rate selection is invalid.
The server index in the tick rate selection is out of range.
The client send index in the tick rate selection is out of range.
The server send index in the tick rate selection is out of range.
The server send rate in the tick rate selection is larger than the tick rate.
Gets the tick rate for the client.
Gets the count of tick rates in the TickRate.
Gets the tick rate at the specified index.
The index of the tick rate to get.
The tick rate at the specified index.
Gets the divisor for the tick rate at the specified index.
The index of the tick rate to get the divisor for.
The divisor for the tick rate at the specified index.
Thrown when the index is out of range.
Thrown when the client tick rate is not divisible by the tick rate at the specified index.
Gets the tick rate at the specified index.
The index of the tick rate to get.
The tick rate at the specified index.
Thrown when the index is out of range.
Converts the tick rates to an array.
An array containing the tick rates.
Validates the tick rates in the TickRate.
true if the tick rates are valid; otherwise, false.
The tick rates are valid if:
- There is at least one tick rate.
- There are no more than four tick rates.
- The first tick rate is greater than 0.
- Each tick rate is a divisor of the first tick rate.
Clamps the indices in the specified Selection to valid ranges.
The Selection to clamp.
A new Selection with clamped indices. If the TickRate is invalid, returns a default Selection.
Validates the tick rates in the specified Selection.
The Selection to validate.
A ValidateResult that indicates the result of the validation.
The Selection is valid if:
- The TickRate is valid.
- The client tick rate in the Selection matches the client tick rate in the TickRate.
- The server index in the Selection is within the range of available tick rates.
- The server send index in the Selection is within the range of available tick rates.
- The client send index in the Selection is within the range of available tick rates.
- The server send rate in the Selection is not larger than the server tick rate.
Initializes the TickRate class by setting up the valid tick rates and their lookup dictionary.
Checks if the provided TickRate is valid.
The TickRate to validate.
true if the TickRate is valid; otherwise, false.
Checks if the provided tick rate is valid.
The tick rate to validate.
true if the tick rate is valid; otherwise, false.
Retrieves the TickRate associated with the specified tick rate.
The tick rate to retrieve the TickRate for.
The TickRate associated with the specified tick rate.
Thrown when the tick rate is invalid.
Resolves the specified Selection into a Resolved structure.
The Selection to resolve.
A Resolved structure that represents the resolved tick rates.
Gets a read-only list of all available TickRates.
This property ensures that the TickRate class is initialized before returning the list.
A timer that is based on ticks instead of seconds.
Gets a TickTimer that is not running.
Gets a value indicating whether the TickTimer is running.
true if the TickTimer is running; otherwise, false.
Gets the target tick of the TickTimer.
The target tick if the TickTimer is running; otherwise, null.
Checks if the TickTimer has expired.
The NetworkRunner associated with the TickTimer.
true if the TickTimer is alive, the runner is running, and the target tick has been reached or passed; otherwise, false.
Checks if the TickTimer has expired or is not running.
The NetworkRunner associated with the TickTimer.
true if the TickTimer is not running, the runner is not running, or the TickTimer has expired; otherwise, false.
Gets the number of remaining ticks until the TickTimer expires.
The NetworkRunner associated with the TickTimer.
The number of remaining ticks if the TickTimer is alive and running; otherwise, null.
Gets the remaining time in seconds until the TickTimer expires.
The NetworkRunner associated with the TickTimer.
The remaining time in seconds if there are remaining ticks; otherwise, null.
Creates a TickTimer from a specified delay in seconds.
The NetworkRunner associated with the TickTimer.
The delay in seconds to set the TickTimer to.
A TickTimer that will expire after the specified delay in seconds. If the NetworkRunner is not alive or not running, returns a default TickTimer.
Creates a TickTimer from a specified number of ticks.
The NetworkRunner associated with the TickTimer.
The number of ticks to set the TickTimer to.
A TickTimer that will expire after the specified number of ticks. If the NetworkRunner is not alive or not running, returns a default TickTimer.
Returns a string that represents the current TickTimer.
A string that represents the current TickTimer.
The number of available samples.
The maximum number samples that can fit in this series.
True if the series contains zero samples.
True if the series contains the maximum number of samples.
The most recent sample.
The arithmetic mean of the samples in the series.
The variance of the samples in the series.
The standard deviation of the samples in the series.
The smallest value in the series.
The largest value in the series.
Returns the exponentially-weighted average of the series (with smoothing factor alpha).
Adds a new sample to the time series. If the series is already full, the oldest sample will be removed.
The new sample value to be added to the series.
Thrown when the provided value is NaN or Infinity.
Removes all samples and resets statistical values.
A base class for Unity array surrogates.
Unmanaged type of the array elements.
Unmanaged type of the reader/writer for the array elements.
Gets or sets the data array for the UnityArraySurrogate.
Reads data into the UnityArraySurrogate from a specified memory location.
The memory location to read from.
The number of elements to read.
Writes data from the UnityArraySurrogate to a specified memory location.
The memory location to write to.
The number of elements to write.
Initializes the UnityArraySurrogate with a specified capacity.
The capacity to initialize the UnityArraySurrogate with.
A surrogate for serializing a dictionary.
The type of the key.
The type of the key reader writer.
The type of the value.
The type of the value reader writer.
Gets or sets the data property.
Reads data into the UnityDictionarySurrogate from a specified memory location.
The memory location to read from.
The number of elements to read.
Writes data from the UnityDictionarySurrogate to a specified memory location.
The memory location to write to.
The number of elements to write.
Initializes the UnityDictionarySurrogate with a specified capacity.
The capacity to initialize the UnityDictionarySurrogate with.
A surrogate for serializing a linked list.
The type of the elements in the linked list.
The type of the reader writer for the elements in the linked list.
Gets or sets the data property.
Reads data into the UnityLinkedListSurrogate from a specified memory location.
The memory location to read from.
The number of elements to read.
Writes data from the UnityLinkedListSurrogate to a specified memory location.
The memory location to write to.
The number of elements to write.
Initializes the UnityLinkedListSurrogate with a specified capacity.
The capacity to initialize the UnityLinkedListSurrogate with.
Represents a base class for Unity surrogates.
This class is serializable and provides abstract methods for reading, writing, and initializing data.
Reads data from a specified memory location into the UnitySurrogateBase.
The memory location to read from.
The number of elements to read.
Writes data from the UnitySurrogateBase to a specified memory location.
The memory location to write to.
The number of elements to write.
Initializes the UnitySurrogateBase with a specified capacity.
The capacity to initialize the UnitySurrogateBase with.
Represents an interface for Unity surrogates.
This interface provides methods for reading and writing data.
Reads data from a specified memory location.
The memory location to read from.
The number of elements to read.
Writes data to a specified memory location.
The memory location to write to.
The number of elements to write.
Represents a base class for Unity value surrogates.
This class is serializable and provides methods for reading, writing, and initializing data.
The type of the data.
The type of the reader/writer for the data. Must be unmanaged and implement IElementReaderWriter{T}.
Gets or sets the data for the UnityValueSurrogate.
Reads data into the UnityValueSurrogate from a specified memory location.
The memory location to read from.
The number of elements to read.
Writes data from the UnityValueSurrogate to a specified memory location.
The memory location to write to.
The number of elements to write.
Initializes the UnityValueSurrogate with a specified capacity.
The capacity to initialize the UnityValueSurrogate with.
Represents an interface for Unity value surrogates.
This interface provides a property for accessing and modifying the data.
The type of the data.
Gets or sets the data for the Unity value surrogate.
Enum representing the possible modes for adding a system to the Unity player loop.
Add the system as the first child of the parent system.
Add the system as the last child of the parent system.
Add the system before the parent system in the player loop.
Add the system after the parent system in the player loop.
The unique identifier for a network entity.
The size of the network id block in bytes.
IEqualityComparer interface for NetworkId objects.
Determines whether the specified NetworkId objects are equal.
Returns a hash code for the specified NetworkId object.
The size of the network id in bytes.
The alignment of the network id in bytes.
The IEqualityComparer for NetworkId objects.
The raw value of the network id.
Signal if the network id is valid.
Signal if the network id is reserved.
Determines whether the current NetworkId object is equal to another NetworkId object.
A NetworkId object to compare with this object.
true if the current object is equal to the other parameter; otherwise, false.
Compares the current NetworkId object with another NetworkId object.
A NetworkId object to compare with this object.
A value that indicates the relative order of the objects being compared.
Determines whether the specified object is equal to the current NetworkId object.
The object to compare with the current object.
true if the specified object is equal to the current object; otherwise, false.
Determines whether two NetworkId objects are equal.
Determines whether two NetworkId objects are not equal.
Converts the NetworkId object to a boolean value.
Writes the NetworkId to the provided NetBitBuffer.
The buffer to write the NetworkId to.
The NetworkId to write.
Reads a NetworkId from the provided NetBitBuffer.
The buffer to read the NetworkId from.
The NetworkId read from the buffer.
Writes this NetworkId to the provided NetBitBuffer.
The buffer to write this NetworkId to.
Get the hash code for this NetworkId.
String representation of the NetworkId.
String conversion specifically for use in prefixing names of GameObjects.
Enum representing the priority levels for network objects
Priority level assigned to player-related network objects.
High priority level, typically assigned to network objects that require frequent updates.
Medium priority level, typically assigned to network objects that require regular updates.
Low priority level, typically assigned to network objects that require less frequent updates.
Lowest priority level, typically assigned to network objects that require minimal updates.
The primary Fusion component for networked GameObject entities.
This stores the object's network identity and manages the object's state and input authority.
Delegate for determining if a network object should be replicated to a specific player.
The network object in question.
The player to potentially replicate to.
True if the object should be replicated to the player, false otherwise.
Delegate for determining the priority level of a network object for a specific player.
The network object in question.
The player for whom the priority level is being determined.
The priority level of the network object for the player.
The unique identifier for this network entity.
Signal that this comes from a Resume Spawn
The this entity is associated with.
Used for whenever objects need to be sorted in a deterministic order, like
when registering scene objects.
Delegate callback used to override if an object should be replicate to a client or not
Delegate callback used to override priority value for a specific object-player pair
How Object Interest is determined for this object.
Last tick this object received an update.
Flags used for network object prefabs and similar
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 for the unique ID of network entries.
Array of initial child nested entities, that are children of this Object.
Array of all s associated with this network entity.
The ID + Unity GameObject name for this entity.
Returns if this network entity is associated with its , and that runner is not null.
If this object is inserted into the simulation
Returns if is the designated Input Source for this network entity.
Returns if is the designated State Source for this network entity.
Returns if is neither the Input nor State Source for this network entity.
Returns the for this instance,
indicating what snapshot data will be used to render it.
Returns the for this instance,
indicating how snapshot data will be used to render it.
Returns the current interpolation time for this object
Returns the 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.
Returns the 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.
Toggles if this NetworkObject is included in the , which will include the prefab in builds as a Spawnable object.
Awake is called when the script instance is being loaded.
OnDestroy is called when the script instance is being destroyed.
Calculates the total word count for a given NetworkObject.
The NetworkObject for which the word count is to be calculated.
The total word count of the NetworkObject. Returns 0 if the NetworkObject is not alive.
Thrown when a NetworkBehaviour reference is missing in the NetworkBehaviour array of the NetworkObject.
Gets a bitmask of flags, representing the current local authority over this .
Gets a bitmask of flags, representing the supplied RPC authority for this .
Sets which has Input Authority for this Object.
Request state authority over this on shared mode.
Release the state authority over this on shared mode.
Removes input authority from whichever player has it for this object. Only valid when called on a Host or Server peer.
Converts the Network Object to it's NetworkId.
The object to convert
The of the object. Default if the object is not alive (null or destroyed)
Add or remove specific player interest in this NetworkObject. Only the NetworkObject State Authority can set interest.
The player to set interest for
If the player should always be interested in this object
Copies the entire State from another
to copy the State from
Copies the entire State from another based on the
to copy the state from
Return the .
The that is assigned to
The to get the ID from
The of the object. Default if the object is not alive (null or destroyed)
Return the .
The to get the ID from
The of the object. Default if the object is not alive (null or destroyed)
Return the reference on that matches the provided
The that will be used to try to find a with ID equals to
The to be searched
The found . null if the provided is not valid
Returns a string representation of the object.
The StringBuilder to append to.
Enum representing the flags for network objects in the Fusion system.
This enum is marked with the Flags attribute, allowing it to be treated as a bit field.
Represents a state where no flags are set.
Mask for isolating the version part of the flags.
Represents the first version of the network object flags.
Flag indicating that the network object should be ignored.
Flag indicating that the network object is a master client object.
Flag indicating that the network object should be destroyed when the state authority leaves.
Flag indicating that the network object allows state authority override.
Extension methods for the NetworkObjectFlags enum.
Returns the version of the flags.
The flags to get the version of.
The version of the flags.
Check if the flags are the current version.
The flags to check.
True if the flags are the current version, false otherwise.
Sets the flags to the current version.
The flags to set.
The flags with the version set to the current version.
Check if the flags are ignored.
The flags to check.
True if the flags are ignored, false otherwise.
Sets the ignored flag on the flags.
Flags to set the ignored flag on.
Ignored flag value.
The flags with the ignored flag set to the given value.
Sets the flags with the provided mask and value.
The original flags.
The value to be set.
The mask to isolate the part of the flags to be set.
The flags after setting the value with the mask.
This method first clears the part of the flags specified by the mask, then sets that part to the provided value.
NetworkObjectGuid
EqualityComparer for NetworkObjectGuid
Check if two NetworkObjectGuid are equals
Get the hashcode for a NetworkObjectGuid
The Size of the NetworkObjectGuid in bytes
The alignment of the NetworkObjectGuid
The Raw Guid Value of the NetworkObjectGuid
The default value of a NetworkObjectGuid
Create a new NetworkObjectGuid
The guid to use
Create a new NetworkObjectGuid
Data0 of the Guid
Data1 of the Guid
Create a NetworkObjectGuid from a byte array
The byte array to create the NetworkObjectGuid from
Create a NetworkObjectGuid from a byte*
The byte* to create the NetworkObjectGuid from
Signal if the NetworkObjectGuid is valid.
Implicit conversion from Guid to NetworkObjectGuid
Guid to convert from
NetworkObjectGuid
Implicit conversion from NetworkObjectGuid to Guid
NetworkObjectGuid to convert from
Guid
Try to parse a string into a NetworkObjectGuid
String to parse
Parsed NetworkObjectGuid
True if the string was parsed successfully, false otherwise
Parse a NetworkObjectGuid from a string.
The string to parse.
The parsed NetworkObjectGuid.
Compare two NetworkObjectGuid
True if the NetworkObjectGuid are equal, false otherwise
Compare two NetworkObjectGuid
True if the NetworkObjectGuid are not equal, false otherwise
Check if the NetworkObjectGuid is equal to another NetworkObjectGuid
The other NetworkObjectGuid to check against
True if the NetworkObjectGuids are equal, false otherwise
Check if the NetworkObjectGuid is equal to another object
The other object to check against
True if the objects are equal, false otherwise
Get the hashcode for a NetworkObjectGuid
Returns a string representation of the NetworkObjectGuid.
Returns a string representation of the NetworkObjectGuid.
Returns a string representation of the NetworkObjectGuid.
Compare the NetworkObjectGuid to another NetworkObjectGuid
The other NetworkObjectGuid to compare against
0 if the NetworkObjectGuid are equal, -1 if this NetworkObjectGuid is less than the other, 1 if this NetworkObjectGuid is greater than the other
Explicit conversion from NetworkObjectGuid to NetworkPrefabRef
NetworkObjectGuid to convert from
NetworkPrefabRef
NetworkPrefabRef
A decoupled prefab reference. Internally stored as a GUID.
EqualityComparer for NetworkPrefabRef
Check if two NetworkPrefabRef are equals
Get the hashcode for a NetworkPrefabRef
The Size of the NetworkPrefabRef in bytes
The alignment of the NetworkPrefabRef
The Raw Guid Value of the NetworkPrefabRef
The default value of a NetworkPrefabRef
Create a new NetworkPrefabRef
The guid to use
Create a new NetworkPrefabRef
Data0 of the Guid
Data1 of the Guid
Create a NetworkPrefabRef from a byte array
The byte array to create the NetworkPrefabRef from
Create a NetworkPrefabRef from a byte*
The byte* to create the NetworkPrefabRef from
Signal if the NetworkPrefabRef is valid.
Implicit conversion from Guid to NetworkPrefabRef
Guid to convert from
NetworkPrefabRef
Implicit conversion from NetworkPrefabRef to Guid
NetworkPrefabRef to convert from
Guid
Try to parse a string into a NetworkPrefabRef
String to parse
Parsed NetworkPrefabRef
True if the string was parsed successfully, false otherwise
Parse a NetworkPrefabRef from a string.
The string to parse.
The parsed NetworkPrefabRef.
Compare two NetworkPrefabRef
True if the NetworkPrefabRef are equal, false otherwise
Compare two NetworkPrefabRef
True if the NetworkPrefabRef are not equal, false otherwise
Check if the NetworkPrefabRef is equal to another NetworkPrefabRef
The other NetworkPrefabRef to check against
True if the NetworkPrefabRefs are equal, false otherwise
Check if the NetworkPrefabRef is equal to another object
The other object to check against
True if the objects are equal, false otherwise
Get the hashcode for a NetworkPrefabRef
Returns a string representation of the NetworkPrefabRef.
Returns a string representation of the NetworkPrefabRef.
Returns a string representation of the NetworkPrefabRef.
Compare the NetworkPrefabRef to another NetworkPrefabRef
The other NetworkPrefabRef to compare against
0 if the NetworkPrefabRef are equal, -1 if this NetworkPrefabRef is less than the other, 1 if this NetworkPrefabRef is greater than the other
Explicit conversion from NetworkPrefabRef to NetworkObjectGuid
NetworkPrefabRef to convert from
NetworkObjectGuid
Enum representing various flags for a network object header.
Each flag represents a different state or property of a network object.
Flag indicating that the object is of global interest.
Flag indicating that the object should be destroyed when the state authority leaves.
Flag indicating that the object was spawned by a client.
Flag indicating that the state authority override is allowed.
Flag indicating that the object is a struct.
Flag indicating that the object is an array of structs.
Flag indicating that the object should not be destroyed on load.
Flag indicating that the object has a main network TRSP.
Flag indicating that the object is in an area of interest.
Represents a pointer to a NetworkObjectHeader.
This struct is unsafe because it uses pointers.
Pointer to a NetworkObjectHeader.
Gets the Type of the NetworkObjectHeader this struct points to.
Gets the Id of the NetworkObjectHeader this struct points to.
Network object header information for a .
The size of the NetworkObjectHeader in bytes.
The size of the NetworkObjectHeader in words.
The word index of the player data in the NetworkObjectHeader.
The unique identifier of the network object.
The number of words in the network object header.
The number of behaviours in the network object.
The type identifier of the network object.
The unique identifier of the root network object in the nesting hierarchy.
The nesting key of the network object.
The flags indicating various states or properties of the network object.
The player reference who has input authority over the network object.
The player reference who has state authority over the network object.
The unique data for each player.
Reserved space for future use.
how many bytes this headers object is
Returns a pointer to the data of a NetworkObjectHeader.
Pointer to the NetworkObjectHeader.
Pointer to the data of the NetworkObjectHeader.
Returns the count of data words in a NetworkObjectHeader.
Pointer to the NetworkObjectHeader.
The count of data words in the NetworkObjectHeader.
Returns a pointer to the array of behaviour change ticks in a NetworkObjectHeader.
Pointer to the NetworkObjectHeader.
Pointer to the array of behaviour change ticks in the NetworkObjectHeader.
Checks if a NetworkObjectHeader has a main network TRSP.
Pointer to the NetworkObjectHeader.
True if the NetworkObjectHeader has a main network TRSP, false otherwise.
Returns a pointer to the main network TRSP data of a NetworkObjectHeader, if it exists.
Pointer to the NetworkObjectHeader.
Pointer to the main network TRSP data of the NetworkObjectHeader if it exists, null otherwise.
The string representation of the NetworkObjectHeader.
Checks if the current instance of NetworkObjectHeader is equal to another instance of the same type.
Checks if the current instance of NetworkObjectHeader is equal to another object.
Generates a hash code for the current instance of NetworkObjectHeader.
Determines if two instances of NetworkObjectHeader are equal.
True if the instances are equal; otherwise, false.
Determines if two instances of NetworkObjectHeader are not equal.
True if the instances are not equal; otherwise, false.
Compute the CRC of this Object Snapshot
Interface for initializing network objects.
Initializes the network object.
The network object to initialize.
Initializes network objects for Unity.
Initializes the network object.
The network object to initialize.
Meta information about a network object.
Get the NetworkObjectTypeId of this object.
Get the NetworkId of this object.
Get the Player that has state authority over this object.
Get the Player that has input authority over this object.
A key used to identify a network object nesting.
Implements the IEqualityComparer interface.
Determines whether two NetworkObjectNestingKey objects are equal.
Returns a hash code for the specified NetworkObjectNestingKey.
The size of the NetworkObjectNestingKey in bytes.
The alignment of the NetworkObjectNestingKey in bytes.
The value of the NetworkObjectNestingKey.
Checks if the NetworkObjectNestingKey is none.
True if the value of the NetworkObjectNestingKey is 0; otherwise, false.
Checks if the NetworkObjectNestingKey is valid.
True if the value of the NetworkObjectNestingKey is greater than 0; otherwise, false.
Initializes a new instance of the NetworkObjectNestingKey struct with a specified value.
The value of the NetworkObjectNestingKey.
Checks if the current instance of NetworkObjectNestingKey is equal to another instance of the same type.
An instance of NetworkObjectNestingKey to compare with the current instance.
True if the current instance is equal to the other parameter; otherwise, false.
Checks if the current instance of NetworkObjectNestingKey is equal to another object.
An object to compare with the current instance.
True if the current instance is equal to the obj parameter; otherwise, false.
Serves as the default hash function.
A hash code for the current object.
Returns a string that represents the current object.
A string that represents the current object.
Interface which defines the handlers for Spawn() and Despawn() actions.
Passing an instance of this interface to
as the argument value will assign that instance
as the handler for runner Spawn() and Despawn() actions.
By default (if == null) actions will use Instantiate(), and Despawn() actions will use Destroy().
Acquires an instance of a prefab for a network object.
The NetworkRunner that manages the network objects.
The context that provides information for acquiring the prefab instance.
The acquired NetworkObject instance.
A NetworkObjectAcquireResult indicating the result of the operation.
Releases an instance of a network object.
The NetworkRunner that manages the network objects.
The context that provides information for releasing the network object instance.
Represents the context for acquiring a prefab instance for a network object.
This struct is unsafe because it uses pointers.
The identifier of the prefab.
The metadata of the network object.
Indicates whether the operation is synchronous.
Indicates whether the network object should not be destroyed on load.
Initializes a new instance of the NetworkPrefabAcquireContext struct with the specified parameters.
The identifier of the prefab.
The metadata of the network object.
Indicates whether the operation is synchronous.
Indicates whether the network object should not be destroyed on load.
Checks if the Header is not null.
True if the Header is not null; otherwise, false.
Gets the data pointer to the first word of this NetworkObject's data block.
Data pointer to the first word of this NetworkObject's data block.
Thrown when the Header is null.
Represents the context for releasing a network object.
This struct is unsafe because it uses pointers.
The network object to be released.
The type identifier of the network object.
Indicates whether the network object is being destroyed.
Indicates whether the network object is a nested object.
Initializes a new instance of the NetworkObjectReleaseContext struct with the specified parameters.
The network object to be released.
The type identifier of the network object.
Indicates whether the network object is being destroyed.
Indicates whether the network object is a nested object.
Returns a string that represents the current object.
A string that represents the current object.
Enum representing the possible results of acquiring a prefab instance for a network object.
Indicates that the prefab instance was successfully acquired.
Indicates that the acquisition of the prefab instance failed.
Indicates that the acquisition of the prefab instance should be retried.
Indicates that the acquisition of the prefab instance should be ignored.
A dummy implementation of the INetworkObjectProvider interface.
This class is used for testing purposes and throws a NotImplementedException for all its methods.
This class is used to compare two NetworkObject instances based on their SortKey.
It implements the IComparer interface.
An instance of the NetworkObjectSortKeyComparer class.
Compares two NetworkObject instances based on their SortKey.
The first NetworkObject to compare.
The second NetworkObject to compare.
A signed integer that indicates the relative values of x and y.
The NetworkObjectStats class provides statistics related to a network object.
It includes bandwidth, updates, and player count within the area of interest.
Represents the inbound bandwidth of the network object.
Represents the outbound bandwidth of the network object.
Represents the inbound updates of the network object.
Represents the outbound updates of the network object.
Represents the count of players within the area of interest of the network object.
Resets all the statistics of the network object to their default values.
Enum representing the type of a NetworkObject.
Represents a NetworkObject that is a Prefab.
Represents a NetworkObject that is a Custom type.
Represents a NetworkObject that is an InternalStruct.
Represents a NetworkObject that is a SceneObject.
Represents an Invalid NetworkObject type.
ID for a Prefab which has been cataloged in a .
Comparer
Checks if two NetworkObjectTypeId instances are equal.
Gets the hash code of a NetworkObjectTypeId instance.
The NetworkObjectTypeId instance.
Represents the size of a NetworkObjectTypeId in bytes.
Represents the alignment of a NetworkObjectTypeId in memory.
Represents the maximum number of SceneObjects that can be represented by a NetworkObjectTypeId.
An instance of the NetworkObjectTypeId EqualityComparer class.
Represents a NetworkObjectTypeId for the PlayerData.
Gets the kind of the NetworkObjectTypeId.
Creates a NetworkObjectTypeId from a SceneRef, an object index, and an optional NetworkSceneLoadId.
The SceneRef to use.
The object index to use.
The NetworkSceneLoadId to use. Defaults to default(NetworkSceneLoadId).
A NetworkObjectTypeId that represents a SceneObject with the given SceneRef, object index, and NetworkSceneLoadId.
Thrown when the provided SceneRef is not valid.
Thrown when the provided object index is out of range.
Gets the NetworkSceneObjectId representation of the NetworkObjectTypeId assuming it is a SceneObject.
The NetworkSceneObjectId representation of the NetworkObjectTypeId.
Thrown when the NetworkObjectTypeId is not a SceneObject.
Creates a NetworkObjectTypeId from a NetworkPrefabId.
The NetworkPrefabId to use.
A NetworkObjectTypeId that represents a Prefab with the given NetworkPrefabId.
Thrown when the provided NetworkPrefabId is not valid.
Gets the NetworkPrefabId representation of the NetworkObjectTypeId assuming it is a Prefab.
The NetworkPrefabId representation of the NetworkObjectTypeId.
Thrown when the NetworkObjectTypeId is not a Prefab.
Creates a NetworkObjectTypeId from a raw uint value representing a Custom type.
The raw uint value to use.
A NetworkObjectTypeId that represents a Custom type with the given raw value.
Gets the raw uint value representation of the NetworkObjectTypeId assuming it is a Custom type.
The raw uint value representation of the NetworkObjectTypeId.
Thrown when the NetworkObjectTypeId is not a Custom type.
Creates a NetworkObjectTypeId from a ushort value representing an InternalStruct type.
The ushort value to use.
A NetworkObjectTypeId that represents an InternalStruct type with the given ushort value.
Gets the ushort value representation of the NetworkObjectTypeId assuming it is an InternalStruct type.
The ushort value representation of the NetworkObjectTypeId.
Thrown when the NetworkObjectTypeId is not an InternalStruct type.
Represents the first part of the value of a NetworkObjectTypeId.
Represents the second part of the value of a NetworkObjectTypeId.
Checks if the NetworkObjectTypeId is invalid.
Checks if the NetworkObjectTypeId is valid.
Checks if the NetworkObjectTypeId is a SceneObject.
Checks if the NetworkObjectTypeId is a Prefab.
Checks if the NetworkObjectTypeId is an InternalStruct.
Checks if the NetworkObjectTypeId is a Custom type.
Checks if the current NetworkObjectTypeId instance is equal to another NetworkObjectTypeId instance.
The other NetworkObjectTypeId instance to compare with the current instance.
Generates a hash code for the current NetworkObjectTypeId instance.
Determines whether the specified object is equal to the current NetworkObjectTypeId instance.
The object to compare with the current NetworkObjectTypeId instance.
Returns a string that represents the current NetworkObjectTypeId instance.
Determines whether two NetworkObjectTypeId instances are equal.
Determines whether two NetworkObjectTypeId instances are not equal.
Converts a NetworkPrefabId instance to a NetworkObjectTypeId instance.
The NetworkPrefabId instance to convert.
A NetworkObjectTypeId instance that represents a Prefab with the given NetworkPrefabId.
Interface for a network asset source.
Type of the network asset.
Acquires the network asset.
If true, the acquisition is done synchronously.
Releases the network asset.
Waits for the result of the network asset acquisition.
The network asset.
Checks if the network asset acquisition is completed.
Gets the description of the network asset.
Interface for a network prefab source.
Gets the GUID of the network object asset.
This class represents the data for a network object prefab.
The unique identifier for the network object.
ID for a Prefab which has been cataloged in a .
Equality comparer for NetworkPrefabId.
Checks if two NetworkPrefabId are equal.
Gets the hash code of a NetworkPrefabId.
The size of a NetworkPrefabId.
The alignment of a NetworkPrefabId.
The maximum index value of a NetworkPrefabId.
The raw value of the NetworkPrefabId.
Checks if the NetworkPrefabId is none.
Checks if the NetworkPrefabId is valid.
Converts the NetworkPrefabId to an index.
Creates a NetworkPrefabId from an index.
Creates a NetworkPrefabId from a raw value.
Checks if the NetworkPrefabId is equal to another NetworkPrefabId.
Checks if the NetworkPrefabId is equal to another object.
Gets the hash code of the NetworkPrefabId.
Converts the NetworkPrefabId to a string.
Compares the NetworkPrefabId to another object.
Converts the NetworkPrefabId to a string with optional brackets and prefix.
Checks if two NetworkPrefabId are equal.
Checks if two NetworkPrefabId are not equal.
Compares the NetworkPrefabId to another NetworkPrefabId.
Meta data for a prefab which has been cataloged in a .
Prefab ID.
Use
to look up the actual prefab reference in the .
Header data for the prefab.
Is the prefab supposed to be loaded in a synchronous way. Fusion will report an error
if this field is set to true and no prefab is returned by .
If the Header is not null.
Data pointer to the first word of this 's data block.
Enum representing the possible results of attempting to get a prefab from the NetworkPrefabTable.
The prefab was successfully retrieved.
The retrieval of the prefab is in progress.
The prefab was not found in the NetworkPrefabTable.
There was an error in loading the prefab.
Class representing a table of network prefabs.
Options for the NetworkPrefabTable.
All prefab sources.
Acquired prefabs mask.
Data about acquired prefabs. Only indices matched by are valid.
Translates guid to index in .
Incremented every time a change occurs.
All prefab sources.
Prefab table version. Incremented every time a change occurs.
Returns all entries in the table.
Adds a prefab source to the table.
Prefab source to add.
Thrown if a prefab source with the same guid already exists.
Tries to add a prefab source to the table.
Prefab source to add.
Id of the prefab source.
True if the prefab source was added, false otherwise.
Thrown if is null.
Gets a prefab source by guid.
Guid of the prefab source.
The prefab source, or default if not found.
Gets a prefab source by id.
Id of the prefab source.
The prefab source, or default if not found.
Gets a prefab id by guid.
Guid of the prefab source.
The prefab id, or default if not found.
Gets a prefab guid by id.
Id of the prefab source.
The prefab guid, or default if not found.
Get the instance count of a prefab id.
Id of the prefab.
The instance count, or 0 if not found.
Add an instance of a prefab id.
Id of the prefab.
The new instance count, or 0 if not found.
Remove an instance of a prefab id.
Id of the prefab.
The new instance count, or 0 if not found.
Returns true if the prefab table contains a prefab with the given id.
Id of the prefab.
True if the prefab table contains a prefab with the given id.
Signal if a prefab id has been acquired.
Id of the prefab.
True if the prefab id has been acquired.
Load a prefab by id.
Id of the prefab.
If true, the load will be synchronous.
The loaded prefab, or null if not found.
Unload a prefab by id.
Id of the prefab.
True if the prefab was unloaded, false otherwise.
Unload all unreferenced prefabs.
If true, incomplete loads will be unloaded as well.
The number of prefabs unloaded.
Unload all prefabs.
Clear the prefab table.
Options for the NetworkPrefabTable.
If true, prefabs will be unloaded when the last instance is released.
If true, all prefabs will be unloaded on shutdown.
Default options.
Provides constants and methods for managing authority masks.
Constant representing the state authority mask.
Constant representing the input authority mask.
Constant representing the proxy authority mask.
Constant representing no authority.
Constant representing all authorities.
Creates an authority mask based on the provided state and input flags.
If true, the state authority is included in the mask.
If true, the input authority is included in the mask.
An integer representing the created authority mask.
Flags a method as being a networked Remote Procedure Call.
Only usable in a NetworkBehaviour.
Calls to this method (from the indicated allowed ) will generate a network message,
which will execute the method remotely on the indicated .
The RPC method can include an empty argument, that will include meta information about the RPC on the receiving peer.
Example:
| [Rpc(RpcSources.All, RpcTargets.All, InvokeLocal = false, InvokeResim = false, Channel = RpcChannel.Reliable, TickAligned = true)]
| public void RPC_Configure(NetworkObject no, string name, Color color, RpcInfo info = default) { }
To target a specific Player, use the :
| [Rpc]
| public void RpcFoo([RpcTarget] PlayerRef targetPlayer) {}
Use as a return value to access meta information about the RPC send attempt, such as failure to send reasons, message size, etc.
Non-static RPCs are only valid on a .
Static RPCs can be implemented on s, and do not require a instance.
Static RPC require the first argument to be NetworkRunner.
Static RPC Example:
| [Rpc]
| public static void RPC_Configure(NetworkRunner runner) { }
The legal types that can trigger this Rpc. Cast to int.
Default value is (int).
The types that will receive and invoke this method. Cast to int.
Default value is (int).
Indicates if the method should be called locally (on the RPC caller). This happens immediately.
Default value is true.
Specifies which RpcChannel to use.
Default value is
Indicates if this RPC's execution will be postponed until the local simulation catches up with the sender's Tick number.
Even if set to false, the order of Rpcs is always preserved. Rpcs are deferred until all preceding Rpcs have
executed.
Default value is true.
Options for when the game is run in mode and RPC is invoked by the host.
Constructor for RpcAttributes.
Constructor for RpcAttributes.
The legal types that can trigger this Rpc. Default is
The types that will receive and invoke this method. Default is
Maximum allowed size for the payload of the RPC message.
Flags for the RPC channel.
Rpc order preserved, delivery verified, resend in case of a failed delivery.
Rpc order preserved, delivery not verified, no resend attempts.
Header for RPC messages.
The size of the RpcHeader structure in bytes.
The NetworkId of the object associated with the RPC message.
The behaviour associated with the RPC message.
The method associated with the RPC message.
Writes the RpcHeader to the provided byte pointer.
The RpcHeader to write.
The byte pointer to write the RpcHeader to.
Returns the size of the RpcHeader structure in bytes.
Reads the size of the RpcHeader from the provided byte pointer.
The byte pointer to read the RpcHeader size from.
Returns the size of the RpcHeader structure in bytes.
Reads the RpcHeader from the provided byte pointer.
The byte pointer to read the RpcHeader from.
The size of the RpcHeader structure in bytes.
Returns the RpcHeader read from the byte pointer.
Creates a new RpcHeader with the provided NetworkId, behaviour, and method.
The NetworkId of the object associated with the RPC message.
The behaviour associated with the RPC message.
The method associated with the RPC message.
Returns a new RpcHeader with the provided parameters.
Creates a new RpcHeader with the provided staticRpcKey.
The staticRpcKey associated with the RPC message.
Returns a new RpcHeader with the provided staticRpcKey.
Returns a string that represents the current RpcHeader.
Returns a string that represents the current RpcHeader.
Options for when the game is run in mode and RPC is invoked by the host.
If host invokes RPC will be set to (default).
If host invokes RPC will be set to the host's local player.
RpcInfo is a struct that contains information about the RPC message.
Represents the tick at which the RPC message was sent.
Represents the player who sent the RPC message.
Represents the channel through which the RPC message was sent.
Indicates whether the RPC message is invoked locally.
Creates a new RpcInfo instance for a local RPC message.
The NetworkRunner associated with the RPC message.
The RpcChannel through which the RPC message was sent.
The RpcHostMode of the RPC message.
Returns a new RpcInfo instance with the provided parameters.
Creates a new RpcInfo instance from a SimulationMessage.
The NetworkRunner associated with the RPC message.
The SimulationMessage from which to create the RpcInfo instance.
The RpcHostMode of the RPC message.
Returns a new RpcInfo instance with the provided parameters.
Returns a string that represents the current RpcInfo.
Returns a string that represents the current RpcInfo.
Represents the data required to invoke an RPC message.
Represents the key associated with the RPC message.
Represents the sources of the RPC message.
Represents the targets of the RPC message.
Represents the delegate to be invoked for the RPC message.
Returns a string that represents the current RpcInvokeData.
Returns a string that represents the current RpcInvokeData.
Represents a delegate that can be invoked by an RPC message.
The NetworkBehaviour associated with the RPC message.
The SimulationMessage associated with the RPC message.
The RpcInvokeDelegate is used to invoke an RPC message. The delegate is invoked by the RpcSystem
when an RPC message is received. The delegate is invoked with the NetworkBehaviour associated with
the RPC message and the SimulationMessage associated with the RPC message.
May be used as an optional return value. Contains meta data about the RPC send, such as failure to send reasons, culling, message size, etc.
Example:
| [Rpc]
| public RpcInvokeInfo RpcFoo(int value) {
| return default;
| }
|
| public override void FixedUpdateNetwork() {
| var info = RpcFoo();
| Debug.Log(info);
| }
Represents the result of the local RPC invocation.
Represents the result of the RPC message send operation.
Contains detailed information about the RPC send operation result.
Returns a string that represents the current RpcInvokeInfo.
Results for the local RPC Invocation of the RPC method.
RPC has been invoked locally.
Not invoked locally because is false.
Not invoked locally because InvokeResim is false and simulation stage is
Not invoked because source current authority does not match flags set in
Not invoked because target player is local and this current authority does not match flags set in
Not invoked because target player is not local.
RPC is too large. See for the maximum allowed size.
Results for the RPC message send operation. Note: Some individual targets may be culled even if the send operation succeeds.
Information about culled targets can be found in .
RPC has been sent. Check for details.
Send culled because is false.
Send culled because source current authority does not match flags set in
Send culled because there are no active connections.
Send culled because target player does not exist.
Send culled because target player is local and is false.
RPC message size is too large to be sent. See for the maximum allowed size.
RPC send operation result information.
Result flags for the RPC send operation.
The size of the RPC message.
Returns a string that represents the current RpcSendResult.
Enum representing the sources of an RPC message.
Represents the state authority source of an RPC message.
Represents the input authority source of an RPC message.
Represents the proxy source of an RPC message.
Represents all possible sources of an RPC message.
Represents a delegate that can be invoked by an RPC message.
The NetworkRunner associated with the RPC message.
The SimulationMessage associated with the RPC message.
The RpcInvokeDelegate is used to invoke an RPC message. The delegate is invoked by the RpcSystem
when an RPC message is received. The delegate is invoked with the NetworkRunner associated with
the RPC message and the SimulationMessage associated with the RPC message.
RPC attribute used to indicate a specific target player for an RPC when sending from one player to another.
RPC is sent to the server, and then is forwarded to the specified player.
Usage:
| [Rpc]
| public void RpcFoo([RpcTarget] PlayerRef targetPlayer) { }
RPC Attribute constructor.
Enum representing the targets of an RPC message.
Represents the state authority target of an RPC message.
Represents the input authority target of an RPC message.
Represents the proxy target of an RPC message.
Represents all possible targets of an RPC message.
Enum representing the status of an RPC target.
Represents an unreachable RPC target.
Represents the RPC target as self.
Represents a remote RPC target.
Project configuration settings specific to how the Host Migration behaves.
Enabled the Host Migration feature
Delay between Host Migration Snapshot updates
Transitory Holder with all necessary information to restart the Fusion Runner
after the Host Migration has completed
New GameMode the local peer will assume after the Host Migration
Host Migration related code in order to get a copy of the Simulation State
Host Migration related code in order to get a copy of the Simulation State
Represents a Server or Client Simulation.
All Scene related API and fields
if this instance is a resume (host migration)
Compute and send a Host Migration Snapshot to the Photon Cloud
Task with the result of the operation. True if it was successful, false otherwise.
Iterate over the old NetworkObjects from the Resume Snapshot
Iterable list of
Iterate over the Scene NetworkObjects from the Resume Snapshot while giving the reference of the old
Snapshot data associated with that particular Scene Object
Iterable list of Scene and Scene Object Header
Temporary Host Migration Snapshot data buffer
Temporary Host Migration Snapshot Data buffer size
Gets a temporary representation of a from the old Server Snapshot
Setup Host Migration information
Host Migration info
Start the Host Migration process
Base Snapshot to be used when restarting the Host
Signal the Host Migration process has started
Try to send a Host Snapshot to Plugin
Get the Snapshot Host Migration Data
True if the snapshot was properly captured
Enumeration of Fusion.Runtime.dll options.
Use the Debug version of the Fusion.Runntime.dll.
Use the Debug version of the Fusion.Runntime.dll.
Initialization stages of Fusion
Runner is about to start
Runner is running
Runner is shutdown
Get Fusion.Runtime.dll build type.
Delegate type for on before spawned callback
Delegate type for object callback
Event for object acquired
Stores the Shutdown parameters used when requesting a Shutdown from inside a Runner Callback
Is the runner updating the simulation.
Completion Source for the startup Photon Cloud Operations
Check if the Runner was properly Initialized
Signal if the OnGameStarted was invoked already
A queue of simulation behaviours that were attached to the runner by AddGlobal and implement the ISpawned interface.
But the spawned call is delayed to when the RuntimeConfig is ready.
Indicates if this is collecting .
The current topology used
Returns the for this .
Returns the flags for The type of network peer the associated represents.
Returns the current stage of this .
Returns the fixed tick time interval. Derived from the .
The time the current State 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).
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).
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).
Returns if this is valid and running.
If the runner is shutdown
Has the shutdown been deferred.
Are we dealing with a regular, planned shutdown.
Get the local time alpha value
Get the latest confirmed tick of the server we are aware of
If the runner is pending to start
Returns if this represents a Client connection.
Returns if this Client is currently connected to a Remote Server
Returns if this represents a Server connection.
Returns true if this runner represents a Client or Host. Dedicated servers have no local player and will return false.
Returns true if this runner was started as single player (Started as with = 1).
If this is the last tick that is being executed this update
If this is the first tick that executes this update or re-simulation
If this is not a re-simulation but a new forward tick
If we are currently executing a client side prediction re-simulation.
The current state of the runner, if it's Starting, Running, Shutdown
Returns a for the local simulation. For a dedicated server 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.
The tick associated with the current state of networked objects, or the current simulation tick being processed (when evaluated during FixedUpdateNetwork).
Returns the reference.
Reference to the .
Returns how many ticks we executed last update.
Returns the collection of objects for this NetworkRunner's .
Returns the instance.
Returns the instance.
Global CancellationTokenSource for this NetworkRunner Instance
Used to control all async operations along the life cycle of the Runner
Should be used in conjunction with
Global copy of the Cancellation Token for this NetworkRunner Instance
Returns the global instance of a lag compensation buffer .
Disconnects a player from the server.
The player to disconnect. Must be a valid PlayerRef.
Optional byte array. If provided, it will be used as the disconnection token.
This method can only be called from the server. If called from a client, an error message will be logged.
Disconnect a client based on its NetAddress
NetAddress of the client
Connect this as a client to a Server.
Initiates a .
Called by the simulation when the RuntimeConfig is first acknowledged.
OnGameStarted Callback
Invoke OnGameStarted callback
Starts using the supplied arguments.
Pauses the game in single player
Continues a paused game in single player
Sets the paused state in a single player
Get the number of interfaces of the desired type that are registered on the behaviour updater.
The interface type
The number of interfaces
Get the interface list head.
The interface type
The desired index on the list of behaviourList
The head reference
A disposable to be used on an `using` scope
Get the previous behaviour
The reference behaviour to get the previous one
Gives the previous behaviour
Get the next behaviour
The reference behaviour to get the next one
Gives the next behaviour
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.
PlayerRef to get the Actor Number (ID)
Actor Number associated with the PlayerRef, otherwise null.
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.
PlayerRef to get the UserID. If no PlayerRef is passed, the UserID of the local client is returned instead.
UserID if valid player found, otherwise null.
Sets the network object associated with this player
PlayerRef to set the network object
Network object to associate with the player
Gets the network object associated with a specific player
PlayerRef to get the network object
Network object if one is associated with the player
Try to gets the associated with a specific player
PlayerRef to get the network object
Network object if one is associated with the player
Signals if it was able to get a for the player provided
Get a list with all behaviours of the desired type that are registered on the .
type
The result list
Add on the list all behaviours of the desired type that are registered on the .
Note: The list will not be cleared before adding the results.
The list to add the behaviours
type
Returns the player round trip time (ping) in seconds
The player you want the round trip time for
Sends RPC message. Not meant to be used directly, ILWeaver calls this.
SimulationMessage to send
Sends RPC message. Not meant to be used directly, ILWeaver calls this.
SimulationMessage to send
RpcSendResult
Checks if the provided player is valid in the current simulation.
The player reference to be validated.
Returns true if the player is valid, false otherwise.
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
PlayerRef to check for a Connection Token
Copy of the Connection Token
Return the with a Remote .
Valid only when invoked from a Server ()
Remote Player to check the
with a
Returns an array of all instances registered with this .
The type of the behaviours to be returned.
An array of instances of the specified type.
Populate the provided list with all registered behaviours and their BehaviourStats.
The list to be populated
Returns true if at least one item is added to the list
Register an instance for callbacks from this .
Callbacks to register
Unregister an instance for callbacks from this .
Callbacks to unregister
This method is meant to be called by .
Promote a player to be the new master client. Only the master client is able to call this method
The player to be promoted to master client
This method is meant to be called by .
Search on the runner object for instances of and register them for callbacks on this .
Disabled components are not registered.
Sends a reliable data buffer to a target player.
The player who should receive the buffer.
The key associated with the reliable data.
The data buffer to be sent.
Sends a reliable data buffer to the server.
The key associated with the reliable data.
The data buffer to be sent.
If the runner is a client, the data is sent to the server (connection index 0) with the player's index.
If the runner is a server, the data is sent via the simulation callbacks.
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. Only the NetworkObject State Authority can set interest.
The player
The object
If he's always interested, or not.
Returns the data from player, converted to the indicated .
Returns the unconverted unsafe for the indicated player.
Outputs the from player, translated to the indicated .
Get the instance for this from a .
NetworkID to look forward
null if object cannot be found.
Get the instance for this from a .
Object NetworkID to look forward
NetworkObject reference, if found
True if object was found.
Try to find an Network Scene Object based on its TypeId.
Object NetworkType ID to look forward
Scene NetworkObject reference, if found
True if object was found.
Get the instance for this from a .
NetworkBehaviourId to look forward
NetworkBehaviour reference, if found
True if object was found.
Try to find a with the provided NetworkBehaviourId.
The NetworkBehaviourId to search for
The behaviour found
A type
Returns true if the behaviour was found and it is alive. False otherwise
Tries to return the first instance of T found on the root of a .
The type of the component to search for
NetworkId of the to search for
Returns the found component. Null if the cannot be found, or if T cannot be found on the GameObject.
Tries to return the behaviour .
NetworkBehaviour to get the from
Returns the of the provided behaviour. Returns default if the behaviour is not alive or the that has this behaviour is not valid.
Tries to return a for the provided.
NetworkBehaviour to get the from
Returns a to the provided behaviour. Returns default if the behaviour is not alive or the that has this behaviour is not valid.
Sets the simulation state for this object, if it takes part in the NetworkFixedUpdate, etc.
the object to change state for
true if it should be simulated, false if otherwise
true if the state of the object changed, false otherwise
Set the area of interest grid dimensions
X dimension
Y dimension
Z dimension
Can't change grid size in shared mode
Set the area of interest cell size
Size of the cell
Can't change cell size in shared mode
Populates the provided list with data about the current Area of Interest (AOI) cells.
Each element in the list represents one AOI cell.
The list to be populated with AOI cell data. Each tuple in the list contains the center of the AOI cell, its size, the count of players in the cell, and the count of objects in the cell.
Try to get buffer from this NetworkRunner.
Returns false if stats were not available.
Try to get buffer for a player reference from this NetworkRunner.
Returns false if stats were not available.
Try to get buffer for a from this NetworkRunner.
Returns false if stats were not available.
Returns if the contains a reference to a in the current State.
Returns if the contains a with given in the current State.
Destroys a NetworkObject.
The NetworkObject to be destroyed.
This method checks if the local simulation has state authority over the NetworkObject.
If it does, it checks if the NetworkObject exists and has state authority.
If these conditions are met, it destroys the NetworkObject.
Thrown when the NetworkObject does not belong to this runner.
Ensures that a specific component exists on this gameobject.
Returns if a given is present in this gameobject.
Returns true if the was found
Removes a specific from this gameobject, if it exists.
Add and register a to this .
Note: It should NOT be a
Removes a specific from this gameobject, if it exists.
Unregister a instance from the callbacks.
Invalid if NetworkRunner has not been started and initialized.
Attaches a user-created network object to the network.
The network object to attach. Must not be null and must have a valid NetworkTypeId.
Optional PlayerRef. If assigned, it will be the default input authority for this object.
Optional boolean. If true, the object will be allocated in memory and attached to the scene object. Default is true.
Optional boolean. If provided, it will override the master client object setting. Default is null.
Thrown when the provided network object is null.
Thrown when the provided network object has an invalid NetworkTypeId.
Call this every FixedUpdateNetwork to add an area of interest for a player.
Should only be called from the Host/Server in Server client mode.
Should only be called for the local player in shared mode.
Clears the area of interest for a player. This can only be called from the server/host
Test if a player has Interest in a .
Returns null if interest cannot be determined (clients without State Authority are not aware of other client's Object Interest)
Controls if a specific network behaviours state is replicated to all players or not
The behaviour to change replication status for
true = replicate, false = don't replicate
Controls if a specific network behaviours state is replicated to a player or not
The behaviour to change replication status for
The player to change replication status for
true = replicate, false = don't replicate
Attach and assign to this the provided.
Used internally from the default implementation of to register scene objects.
Registers scene objects to the network.
The scene reference. Must be valid.
Array of NetworkObject instances to be registered. Must not be null.
Optional NetworkSceneLoadId. Default value is used if not provided.
The number of objects registered.
Thrown when the provided scene is not valid.
Thrown when the provided objects array is null.
Return the for a specific player.
Get enumerator for the collection of all s. Allows
to enumerate alloc-free.
A list of all s.
Try to get the physics info.
Network physics info
True if the physics info exists, otherwise false.
Try to set the physics info.
Network physics info
True if the physics info was set, otherwise false.
Thrown if the runner does not have the scene authority.
The initial scene info that was used to start the runner. It is consumed before the first tick by the scene authority.
The way this works is a bit complex. The order of things is as follows:
first update -> BeforeFirstTick -> OnServerStart / OnClientStart (master) -> ConsumeInitialSceneInfo
Only then the initial scene info is consumed and is invoked. Any load/unload calls
before that get queued and executed after the initial scene info is consumed.
What caused the scene change. This is either set in or when object is updated remotely.
To pretend the scene info is available before the first tick (important for shared mode), we store the copy of initial scene info
here and modify it/return it instead of the state. After scene info has been consumed, this is no longer needed.
Last used scene info. If is set this is compared
to the current scene info and scenes are loaded/unloaded accordingly.
Completed and nullified once the initial / first remote scene info is consumed. Loads/Unloads that happen before the first tick
depend on the result of this task.
Is this runner responsible for scene management.
Signals if the instance assigned to this is busy
with any scene loading operation.
Tries to get the of this .
The result
Returns true if it was able to get the scene info
Moves a GameObject to a specific scene
Game Object to move
Scene to move the object to
True if the object was moved, false otherwise
Moves a GameObject to the same scene as another GameObject
Game Object to move
Game Object to move to the same scene as
True if the object was moved, false otherwise
Loads a scene
Name of the scene to load
Parameters to use when loading the scene
Should the scene be set as active when loaded
Scene Load operation
Loads a scene
Name of the scene to load
Scene load mode
Scene physics mode
Should the scene be set as active when loaded
Scene Load operation
Loads a scene
Reference to the scene to load
Scene load mode
Scene physics mode
Should the scene be set as active when loaded
Scene Load operation
Unloads a scene
Name of the scene to unload
Scene Unload operation
Invoke on all implementations
Invoke on all implementations
The main scene of the or default if not running.
Get the a GameObject instance belongs to.
GameObject to check for a
reference, or null if not found
Get the from a specific Scene
Scene to check for a
reference, or null if not found
Get the 3D Physics scene being used by this Runner.
Get the 2D Physics scene being used by this Runner.
Instantiates an object in the scene of this runner
Instantiates an object in the scene of this runner
Instantiates an object in the scene of this runner
Instantiates an object in the scene of this runner
Ensures the scene of this runner is active and returns the previous active scene
Previous active scene
True if the scene was changed, false otherwise
Moves an object to the scene of this runner
Component of object to move
Moves an object to the scene of this runner
Object to move
Target scene to move the object to
Mark an object as `DontDestroyOnLoad`.
Object to mark
Signal if the Network Runner can spawn a
Attempts to network instantiate a using a
Note: position and rotation values are only used locally for the instantiation of the object, and are not inherently networked.
Use (or any derived classes) to replicate the initial transform state.
reference, or null if it was not able to spawn the object
Attempts to network instantiate a using a Component type that is part of a
Must be a Type derived from
used to spawn the
T reference, or null if it was not able to spawn the object
Spawn Position
Spawn Rotation
Player Input Authority
reference
Spawn flags
Attempts to network instantiate a using a GameObject. The supplied GameObject must have a component.
A GameObject with a
Spawn Position
Spawn Rotation
Player Input Authority
reference
Spawn flags
reference, or null if it was not able to spawn the object
Attempts to network instantiate a using a prefab.
Note: position and rotation values are only used locally for the instantiation of the object, and are not inherently networked.
Use (or any custom class derived from NetworkTRSP) to replicate the initial transform state.
Prefab used to spawn the
Spawn Position
Spawn Rotation
Player Input Authority
reference
Spawn flags
reference, or null if it was not able to spawn the object
Attempts to network instantiate a using a .
Note: position and rotation values are only used locally for the instantiation of the object, and are not inherently networked.
Use (or any custom class derived from NetworkTRSP) to replicate the initial transform state.
Prefab Ref used to spawn the
Spawn Position
Spawn Rotation
Player Input Authority
reference
Spawn flags
reference, or null if it was not able to spawn the object
Attempts to network instantiate a using a
Note: position and rotation values are only used locally for the instantiation of the object, and are not inherently networked.
Use (or any custom class derived from NetworkTRSP) to replicate the initial transform state.
Object Guid used to spawn the
Spawn Position
Spawn Rotation
Player Input Authority
reference
Spawn flags
reference, or null if it was not able to spawn the object
Attempts to network instantiate a using a
Note: position and rotation values are only used locally for the instantiation of the object, and are not inherently networked.
Use (or any custom class derived from NetworkTRSP) to replicate the initial transform state.
Prefab ID used to spawn the
Spawn Position
Spawn Rotation
Player Input Authority
reference
Spawn flags
reference, or null if it was not able to spawn the object
Attempts to network instantiate a using a Component type that is part of a
Must be a Type derived from
used to spawn the
T reference, or null if it was not able to spawn the object
Spawned reference
Spawn Position
Spawn Rotation
Player Input Authority
reference
Spawn flags
Attempts to network instantiate a using a GameObject. The supplied GameObject must have a component.
A GameObject with a
Spawn Position
Spawn Rotation
Player Input Authority
reference
Spawn flags
Spawned reference
reference, or null if it was not able to spawn the object
Attempts to network instantiate a using a prefab.
Note: position and rotation values are only used locally for the instantiation of the object, and are not inherently networked.
Use (or any custom class derived from NetworkTRSP) to replicate the initial transform state.
Prefab used to spawn the
Spawn Position
Spawn Rotation
Player Input Authority
reference
Spawn flags
Spawned reference
reference, or null if it was not able to spawn the object
Attempts to network instantiate a using a .
Note: position and rotation values are only used locally for the instantiation of the object, and are not inherently networked.
Use (or any custom class derived from NetworkTRSP) to replicate the initial transform state.
Prefab Ref used to spawn the
Spawn Position
Spawn Rotation
Player Input Authority
reference
Spawn flags
Spawned reference
reference, or null if it was not able to spawn the object
Attempts to network instantiate a using a
Note: position and rotation values are only used locally for the instantiation of the object, and are not inherently networked.
Use (or any custom class derived from NetworkTRSP) to replicate the initial transform state.
Object Guid used to spawn the
Spawn Position
Spawn Rotation
Player Input Authority
reference
Spawn flags
Spawned reference
reference, or null if it was not able to spawn the object
Attempts to network instantiate a using a
Note: position and rotation values are only used locally for the instantiation of the object, and are not inherently networked.
Use (or any custom class derived from NetworkTRSP) to replicate the initial transform state.
Prefab ID used to spawn the
Spawn Position
Spawn Rotation
Player Input Authority
reference
Spawn flags
Spawned reference
reference, or null if it was not able to spawn the object
Attempts to network instantiate a using a Component type that is part of a
Must be a Type derived from
used to spawn the
T reference, or null if it was not able to spawn the object
A callback to fire once the spawn is done.
Spawn Position
Spawn Rotation
Player Input Authority
reference
Spawn flags
Attempts to network instantiate a using a GameObject. The supplied GameObject must have a component.
A GameObject with a
Spawn Position
Spawn Rotation
Player Input Authority
reference
Spawn flags,
A callback to fire once the spawn is done.
Attempts to network instantiate a using a prefab.
Note: position and rotation values are only used locally for the instantiation of the object, and are not inherently networked.
Use (or any custom class derived from NetworkTRSP) to replicate the initial transform state.
Prefab used to spawn the
Spawn Position
Spawn Rotation
Player Input Authority
reference
Spawn flags,
A callback to fire once the spawn is done.
Attempts to network instantiate a using a .
Note: position and rotation values are only used locally for the instantiation of the object, and are not inherently networked.
Use (or any custom class derived from NetworkTRSP) to replicate the initial transform state.
Prefab Ref used to spawn the
Spawn Position
Spawn Rotation
Player Input Authority
reference
Spawn flags,
A callback to fire once the spawn is done.
Attempts to network instantiate a using a
Note: position and rotation values are only used locally for the instantiation of the object, and are not inherently networked.
Use (or any custom class derived from NetworkTRSP) to replicate the initial transform state.
Object Guid used to spawn the
Spawn Position
Spawn Rotation
Player Input Authority
reference
Spawn flags,
A callback to fire once the spawn is done.
Attempts to network instantiate a using a
Note: position and rotation values are only used locally for the instantiation of the object, and are not inherently networked.
Use (or any custom class derived from NetworkTRSP) to replicate the initial transform state.
Prefab ID used to spawn the
Spawn Position
Spawn Rotation
Player Input Authority
reference
Spawn flags,
A callback to fire once the spawn is done.
Signal if the Local Peer is connected to Photon Cloud and is able to Create/Join Room but also receive Lobby Updates
Photon Client UserID
Returns null if Peer is not connected to Photon Cloud
used by this Runner to Authenticate the local peer.
Current Game Mode active on the Fusion Simulation
Stores information about the current running session
Signal if the local peer is already inside a Lobby
Signal if the runner was already initialized. Used to avoid recycling of NetworkRunners.
Check the current Connection Type with the Remote Server
Exposes the current NAT Type from the local Peer
Signal if the Local Peer is in a Room and is the Room Master Client
Completion Source for the startup Photon Cloud Operations
Responsible to manage the Photon Cloud related Services
The cached region summary for the local player. Initially empty but populated after the first connection.
Join the Peer to a specific Lobby, either a prebuild or a custom one.
More about matchmaking:
https://doc.photonengine.com/en-us/fusion/current/manual/matchmaking
Lobby Type to Join
Lobby ID
Authentication Values used to authenticate this peer
Custom Photon Application Settings
Signal if the LoadBalancingClient should use the Default or Alternative Ports
Optional Cancellation Token
Signal if the cached regions ping should be used to speed up connection
Async Task to Join a Session Lobby. Can be used to wait for the process to be finished.
Starts the local Fusion Runner and takes care of all major setup necessary
More about matchmaking:
https://doc.photonengine.com/en-us/fusion/current/manual/matchmaking
Custom arguments used to setup the Fusion Simulation
Task that can be awaited to chain actions
Connect the local peer to Photon Cloud using an async process.
Authentication Values used to authenticate this peer
Custom Photon Application Settings
External Communicator that will be reused on restart
External CancellationToken
Signal if the LoadBalancingClient should use the Default or Alternative Ports
Signal if the cached regions ping should be used to speed up connection
Async Task of the connect to Photon Cloud process. Can be used to wait for the process to be finished.
Disconnect the Peer from Photon Cloud
If the Cloud Services were not initialized, it just returns immediately
Async Task of the disconnect from Photon Cloud process. Can be used to wait for the process to be finished.
Start Fusion in Single Player Mode
Initialization Arguments
A running Task of the initialization process
Start Fusion in one of the Cloud Game Modes
Initialization Arguments
A running Task of the initialization process
Shutdown the Fusion Runner based on a arbitrary Exception
Exception used as base for the Shutdown procedure
Awaitable Task of the Shutdown procedure
Signal an update on the list of
New Session Info
Signal an update on the list of
Custom Authentication Response
Interface which defines the handlers for Updates. An implementation
is responsible for calling and
periodically.
An instance of this interface can be passed to
as the . By default (if == null)
Fusion will use , which invokes before
script's Update and before LateUpdate.
Called when the is started.
The instance.
Called when the is stopped.
The instance.
Network Runner Callbacks Delegates
Companion component for . Exposes as UnityEvents,
which can be wired up to other components in the inspector.
UnityEvent for NetworkInput
UnityEvent for NetworkInput with PlayerRef
UnityEvent for ConnectRequest
UnityEvent for ConnectFailed
UnityEvent for DisconnectFromServer
UnityEvent for Shutdown
UnityEvent for PlayerRef
UnityEvent for NetworkRunner
UnityEvent for SimulationMessage
UnityEvent for SessionInfo List
UnityEvent for Custom Authentication
UnityEvent for HostMigration
UnityEvent for Reliable Data
UnityEvent for Reliable Data Progress
UnityEvent for NetworkObject
UnityEvent for NetworkObject with PlayerRef
The core Fusion config file that is shared with all peers at startup.
Options for running one or multiple peers in one Unity instance.
Multiple is useful for testing multiple players/clients inside of the Unity editor without needing to build executables.
Each peer is assigned its own independent physics scene and instance.
This is the normal use case, where every build and the editor run a single server, host or client peer.
This is the optional use case, which allows running multiple peers in the Unity editor, or in a build.
Eventual Consistency state replication options.
Scheduling enables automatic prioritization of objects when culling occurs
(when Object's are not replicated due to exceeding per tick data limits, they increase in priority on the following Tick).
Interest Management enables NetworkObject Area Of Interest and Explicit Interest features.
No special replication handling. This setting is ideal if your project never exceeds per tick data limits during gameplay.
When changed Network Objects are not replicated by the server to a client due to culling (data per tick limit was reached)
the server increases the priority of that Network Object for the next outgoing Tick update to that client.
In addition to scheduling, Interest Management features are also enabled (Area Of Interest and Explicit Interest).
Default file name for the asset
Reference for the default . By default, loads a resource named "NetworkProjectConfig". This behaviour
can be changed with an attribute .
Unloads , if already loaded. If loading has faulted, resets the state
and next call to the accessor will attempt to load the config again.
Current Type ID
Current version
Current version
Current Type ID
Setting for whether multiple peers can run per Unity instance (typically to allow easy testing of multiple peers inside of the editor).
Advanced lag compensation buffer settings.
This flag changes the behaviour of to return null (instead of throwing an exception) and ) to return
if Fusion was unable to load a prefab synchronously (e.g. because it was Addressable). Fusion will enqueue the spawn and attempt to perform it the next frame, until successful.
Useful for transition from Fusion 1.x.
Signal if the callbacks should be invoked in Batch Mode.
Signal if the of the should be included on the name of the .
Inactive need special handling in case they get destroyed without ever being activated. This is achieved
with adding a nested GameObject called "NetworkObjectInactivityGuard" that tracks the OnDestroy message.
can be used to control whether these guards are visible in the hierarchy or not.
Reference to the instance for this .
Reference to settings for this .
this can be used to override the time synchronization from code
Reference to settings for this .
Reference to settings for this
Reference to settings for this
Settings for simulating network conditions of latency and loss.
Heap Settings
Names of assemblies Fusion is going to weave. Not case sensitive.
Use Fusion.SerializableDictionary to store [Networked] dictionary properties initial value. If unchecked,
the weaver will emit System.Generic.Dictionary instead - a type that's not Unity-serializable, but custom
serializers (e.g. Odin) may support it.
If set, the weaver will add a check to all [Networked] properties on each
to verify if owing has been attached to.
If set, the weaver will check if is used in types that do not support it. This requires
all types to be scanned and can increase weaving duration.
If set, the weaver will check if properties getters and setters are empty.
Get the execution order for a given type. If the type is registered, returns null.
Type to check for the execution order.
Execution order for the type, or null if not registered.
Make a copy of the .
ToString() implementation.
Get the version information for the Fusion.Runntime.dll.
Serialize a into a JSON string.
NetworkProjectConfig reference
JSON String
De-serialize a from a JSON string (typically sent by the Room's Creator).
JSON string of a serialized NetworkProjectConfig
NetworkProjectConfig reference de-serialized from JSON string
Remove unnecessary data from serialized version of .
Manages and references the current instance of
The current instance.
The current instance.
Try to get the current instance.
instance if it exists, otherwise null.
True if the instance exists, otherwise false.
True if the instance exists, otherwise false.
Unload the current instance.
An auto-generated list containing source information (e.g. Resource path, address, static reference) for all the prefabs that can be spawned, i.e. the ones with
component and enabled.
Additional prefabs can registered at runtime with .
Options for the .
An auto-generated list containing meta information about all the s in the project, e.g. execution order.
The type of the .
The execution order of the .
An auto-generated list containing meta information about all the s in the project, e.g. execution order.
Network Spawn Status
Spawn is queued and will be spawned when the prefab is loaded.
Spawned successfully.
Failed to Load Prefab Synchronously.
Failed to create instance.
Failed to spawn because the client can't spawn.
Failed to spawn because the local player is not yet set.
Network Spawn Flags
Object get spawned as DontDestroyOnLoad on all clients.
In shared mode, override the state authority to .
In shared mode, override the state authority to local player.
Spawn Operation
Network Runner Reference
Get the spawned Network Object
Get the Spawn Operation Status
Returns true if the object has been spawned.
Returns true if the object is still queued for spawning.
Returns true if the object has failed to spawn.
Get this Spawn Operation
Awaiter for
Awaiter Constructor
Spawn Operation
Returns true if the Spawn Operation is completed
Get the result of the Spawn Operation
Spawned Network Object
Thrown if the Spawn Operation failed
Awaiter OnCompleted Callback
Continuation Action
Thrown if the Spawn Operation is not supported
Network Object Spawn Delegate
Network Object Spawn Exception
Network Object Spawn Exception Constructor
Network Spawn Status
Network Object Type Id
Network Object Type Id
Network Spawn Status
Exception Message
Stores data types used on the interface
Data holder of a Connection Request from a remote client
Address of the remote client
Accepts the Request
Refuses the Request
Refuses the Request
Describes a list of Reason why the Fusion Runner was Shutdown
OK Reason means Fusion was Shutdown by request
Shutdown was caused by some internal error
Raised when the peer tries to Join a Room with a mismatching type between ClientServer Mode and Shared Mode.
Raised when the local peer started as a Server and tried to join a Room that already has a Server peer.
Raised when the Peer is disconnected or kicked by a Plugin Logic.
Raised when the Game the Peer is trying to Join is Closed
Raised when the Game the Peer is trying to Join does not exist
Raised when all CCU available for the Photon Application are in use
Raised when the peer is trying to connect to an unavailable or non-existent Region
Raised when a Session with the same name was already created
Raised when a peer is trying to join a Room with already the max capacity of players
Raised when the Authentication Values are invalid
Raised when the Custom Authentication has failed for some other reason
Raised when the Authentication Ticket has expired
Timeout on the Connection with the Photon Cloud
Raised when Fusion is already running and the StartGame is invoked again
Raised when any of the StartGame arguments does not meet the requirements
Signal this Runner is shutting down because of a Host Migration is about to happen
Connection with a remote server failed by timeout
Connection with a remote server failed because it was refused
The current operation has timed out
The current operation was canceled
Interface for callbacks.
Register a class/struct instance which implements this interface with .
Callback from a when a new has exit the Area of Interest
NetworkRunner reference
NetworkObject reference
PlayerRef reference
Callback from a when a new has entered the Area of Interest
NetworkRunner reference
NetworkObject reference
PlayerRef reference
Callback from a when a new player has joined.
Callback from a when a player has disconnected.
Callback from that polls for user inputs.
The that is supplied expects:
input.Set(new CustomINetworkInput() { /* your values */ });
Callback from when an input is missing.
NetworkRunner reference
PlayerRef reference which the input is missing from
NetworkInput reference which is missing
Called when the runner is shutdown
The runner being shutdown
Describes the reason Fusion was Shutdown
Callback when successfully connects to a server or host.
Callback when disconnects from a server or host.
Callback when receives a Connection Request from a Remote Client
Local NetworkRunner
Request information
Request Token
Callback when fails to connect to a server or host.
This callback is invoked when a manually dispatched simulation message is received from a remote peer
The runner this message is for
The message pointer
This callback is invoked when a new List of Sessions is received from Photon Cloud
The runner this object exists on
Updated list of Session
Callback is invoked when the Authentication procedure returns a response from the Authentication Server
The runner this object exists on
Custom Authentication Reply Values
Callback is invoked when the Host Migration process has started
The runner this object exists on
Migration Token that stores all necessary information to restart the Fusion Runner
Callback is invoked when a Reliable Data Stream has been received
NetworkRunner reference
Which PlayerRef the stream was sent from
ReliableKey reference that identifies the data stream
Data received
Callback is invoked when a Reliable Data Stream is being received, reporting its progress
NetworkRunner reference
Which PlayerRef the stream is being sent from
ReliableKey reference that identifies the data stream
Progress of the stream
Callback is invoked when a Scene Load has finished
NetworkRunner reference
Callback is invoked when a Scene Load has started
NetworkRunner reference
Default implementation of that uses the Unity PlayerLoop.
Default settings for the NetworkRunner Update Loop.
Default settings for the NetworkRunner Render Loop.
Registers in the PlayerLoop.
Update settings.
Render settings.
True if registered, false if already registered with the same settings.
Unregisters from the PlayerLoop.
True if unregistered, false if not registered.
Invokes for all the runners
and stores them for upcoming .
Invokes for all the runners
that have been updated with the last .
Used to invoke in the PlayerLoop.
Used to invoke in the PlayerLoop.
Settings for the .
Reference to the PlayerLoopSystem to add the NetworkRunner to.
Add mode for the PlayerLoopSystem.
Checks if the settings are equal.
Settings to check for equality.
True if equal, false otherwise.
Checks if the settings are equal.
Settings to check for equality.
True if equal, false otherwise.
Gets the hash code of the settings.
Hash code.
Returns a string representation of the settings.
String representation.
Checks if the settings are equal.
Settings to check for equality.
Settings to check for equality.
True if equal, false otherwise.
Checks if the settings are not equal.
Settings to check for equality.
Settings to check for equality.
True if not equal, false otherwise.
Fusion Game Mode.
Used to select how the local simulation will act.
Single Player Mode: it works very similar to Mode, but don't accept any connections.
Shared Mode: starts a Game Client, which will connect to a Game Server running in the Photon Cloud using the Fusion Plugin.
Server Mode: starts a Dedicated Game Server with no local player.
Host Mode: starts a Game Server and allows a local player.
Client Mode: starts a Game Client, which will connect to a peer in either or Modes.
Automatically start as Host or Client. The first peer to connect to a room will be started as a Host, all others will connect as clients.
Fusion Start Arguments, used to configure the simulation mode and other settings
More about matchmaking:
https://doc.photonengine.com/en-us/fusion/current/manual/matchmaking
in which this peer will start
Photon Cloud Session Name used either to Create or Join a Session.
Default: null (random session matching)
Used to generate a new Session Name when creating a Session.
Default: null (a random session name is generated based on a GUID)
Peer Binding Address
Default:
Custom Public Reflexive Address
Default: null
Object pool to use
Default: null
See .
Default: null
More about Scene Loading:
https://doc.photonengine.com/en-us/fusion/current/manual/scene-loading
See
See
Custom used to start the simulation
Default: Global NetworkProjectConfig
More about NetworkProjectConfig:
https://doc.photonengine.com/en-us/fusion/current/manual/network-project-config
Number of players allowed to connect to this peer, when running in Server/Host Mode
Default: DefaultPlayers from the Global NetworkProjectConfig
Scene that will be set as the starting Scene when running in Server/Host Mode
Default: null (no scene set)
Callback that is invoked when the Fusion has fully started
Default: null
Flag to disable the NAT Punchthrough implementation and connect only via Relay
Default: false
User defined callback interfaces we will provide O(1) constant time lookup for
Default: null
Connection token sent by client to server. Not used in shared mode.
Default: null (empty connection token)
Custom Session Properties.
This dictionary can be used to either setup the initial Session Properties when creating a Session
but also to set the matchmaking filters when joining a Random Session.
Default: null (empty custom properties)
Session should be created Open or Closed to accept joins
Default: true
Session should be Visible or not in the Session Lobby list
Default: true
Session Join Matchmaking Mode when joining a Session.
For more information, check
Default:
Signal if the internal Realtime Client should use the Default Photon ports to connect to the Photon Cloud.
By default, Fusion uses ports: 27000, 27001 and 27002.
Set this to True to use ports: 5058, 5055 and 5056.
Default: false (uses ports 27000, 27001 and 27002)
Session Custom Lobby to be published in
Default: null (default Lobby for each Session Type, LobbyClientServer or LobbyShared)
Specify a Custom STUN Server used to Resolve the peer Reflexive Addresses
Default: null (no custom STUN Server)
Custom Authentication Data
Default: null (default authentication values)
Custom Photon Application Settings
Default: null (Global PhotonAppSettings)
Enables the Session creation when starting a Client with an specific Session Name
Default: false (clients *can not* create new Sessions)
Host Migration Token used when restarting the Fusion Simulation
Default: null
Callback invoked when the new Host is migrating from the old Host state
Default: null
Optional CancellationToken used to cancel the NetworkRunner start up process and shutdown
Defaults: null
Enables the usage of the previous cached regions pings. This speeds up the region ping process and the runner startup process.
Defaults: false
StartGameArgs ToString()
Describe an Exception that Occurred while starting the Fusion Simulation
ShutdownReason that caused this exception
StartGameException to String
Represents the result of starting the Fusion Simulation
Signal if the Start was OK
Start Game Shutdown Reason
Custom Error Message filled with data about the Shutdown.
Usually used to store custom data when the StartGame fails.
Optional Exception StackTrace
String representation of the StartGameResult
Convert arbitrary Exceptions into a StartGameException to public use
Exception to be converted
Reference to a StartGameException holding a ShutdownReason
Interface for a scene manager.
A scene manager is responsible for loading and unloading scenes
Callback for initialization
Callback for shutdown and clean up
Signals if the instance is busy with any scene loading operations
The main scene of the . Mostly used for Multipeer logic
Signals if the given scene is the main runner scene. Mostly used for Multipeer logic
Tries to get the physics scene 2D.
Returns true if the operation was successfully
Tries to get the physics scene 3D.
Returns true if the operation was successfully
Mark an object as `DontDestroyOnLoad`.
Move a to a desired scene.
Return true if the operation was successfully
Loads a given scene with the specified parameters.
Returns a that can be waited
Unloads a given scene.
Returns a that can be waited
Gets a for the scene that the given belongs to.
Gets a for the given scene name or path.
Implement this method and return true if you want to handle scene info changes manually. Return false if
the default scene info change handling should be done by the instead.
Return true if a custom handling is provided, false otherwise to use the default one
A wrapper for async scene operations.
The scene reference of the operation
Signals if the operation is valid
Signals if the operation is done
Attached error to the operation
Creates a from a
Scene reference
Async operation reference
Returns a instance
Thrown if is null
Creates a from a
Scene reference
Coroutine reference
Returns a instance
Thrown if is null
Creates a from a
Scene reference
Task reference
Returns a instance
Thrown if is null
Creates a from a
Scene reference
Exception reference
Returns a instance
Thrown if is null
Creates a completed
Scene reference
Returns a instance
Adds a callback to be called when the operation is completed
The callback to be called
Gets the awaiter for the operation
Awaiter for
Creates a new instance
The operation to await
Signals if the operation is completed
Gets the result of the operation
Adds a callback to be called when the operation is completed
The callback to be called
A unique identifier for a scene load operation.
The value of the id
Creates a new with the given value
The value of the id
Compares two for equality
The other
Returns true if the two are equal
Compares two for equality
The other object to check
Returns true if the two are equal
Returns the hash code of the
Parameters for loading a scene
The unique id of the scene load operation
The to use when loading the scene
The to use when loading the scene
The to use when loading the scene
Signals if the scene should be active on load
Signals if the scene should be single loaded
Signals if the scene should have local 2D physics
Signals if the scene should have local 3D physics
Compares two for equality
The other
Returns true if the two are equal
Compares two for equality
The other
Returns true if the two are equal
Returns the hash code of the
Compares two for equality
Left
Right
Returns true if the two are equal
Compares two for inequality
Left
Right
Returns true if the two are not equal
Returns a string representation of the
Network Scene Info Default Flags
The scene count mask
The counter mask
Can store up to 8 active scenes and allows for duplicates.
Each write increases which can be used to generate unique scene objects ids
for when a scene is supposed to be reloaded.
The size of the struct in words
The size of the struct in bytes
Max number of scenes that can be stored
The scenes list
The scenes load parameters list
Gets the index of the given scene
SceneRef to look for
Scene parameters to look for
Returns the index of the scene or -1 if not found
Total Scene Count
Version number
Adds a scene to the list
Scene to add
Load scene mode
Local physics mode
Signals if the scene should be active on load
Returns the index of the scene or -1 if the scene could not be added
Removes a scene from the list
Scene to remove
Returns true if the scene was removed
String representation of the
Compares two for equality
The other
Returns true if the two are equal
Compares two for equality
The other
Returns true if the two are equal
Get the hash code of the
Hast code of the
Implicit conversion to
SceneRef to convert
Returns a instance
What has contributed to the observed change in the scene info.
No change.
The initial local scene has changed.
The remove scene has changed.
A unique identifier for a scene object.
Identifies the scene in which the object is located.
Index of the object in the scene or any other form of unique identifier.
Unique identifier of a specific scene load. Needs to be used when loading multiple scenes with the same or reloading a scene.
For example, increments its internal LoadId every time a new scene is added.
Signal if the is valid.
String representation of the .
Check if two are equal.
Another to check for equality
Returns true if the two are equal
Check if two are equal.
Another to check for equality
Returns true if the two are equal
Get the hash code of the .
Indicates which point in time (or "timeframe") networked properties should be rendered in.
The timeframe will be chosen automatically.
The default timeframe for owned and predicted objects.
The default timeframe for proxied objects.
Indicates how available snapshot data should be used to render networked properties
(in the chosen ).
The rendered value will come from interpolating the values at
and to the desired point in time.
The rendered value will come from the nearest available snapshot at or before the
point in time being rendered.
The rendered value will come from the nearest available snapshot ahead of the
point in time being rendered.
The rendered value will come from the latest snapshot.
Can be used to acquire interpolated data for different points in time.
Get the render data for the given .
Network behaviour to get render data for.
Render data for the previous point in time.
Render data for the next point in time.
Interpolation alpha.
Information used to observe an object in remote time.
Main simulation class
Clears the provided list and populates it with data about the current Area of Interest (AOI) cells.
Each tuple in the list represents one AOI cell, containing its center, size, player count, and object count.
The list to be populated with AOI cell data.
Used by RunnerAOIGizmos component. Supplies data about current active AOI cells.
Area of Interest Definition
Size of each cell in the AOI grid.
Get the size of the AOI grid.
The size of the AOI grid.
Get the size of each cell in the AOI grid.
The size of each cell in the AOI grid.
Convert a sphere into a set of AOI cells.
Sphere center
Sphere radius
Resulting set of cells
Convert a position into the respective cell coordinate.
Position
Cell coordinate
Converts a cell index into its corresponding cell coordinates.
The index of the cell to be converted.
A tuple containing the x, y, and z coordinates of the cell.
Convert a cell index into the respective cell center position.
Cell index
Cell center position
Convert a position into the respective cell index.
Position
Cell index
Convert a cell coordinate into the respective cell index.
X coordinate
Y coordinate
Z coordinate
Cell index
Clamp cell coordinates to the valid range.
X coordinate
Y coordinate
Z coordinate
Clamped cell coordinates
latest tick on server we are aware of
latest tick on server we are aware of
Simulation Stats
How large the ticks the current simulation takes are
The current tick rate of the simulation
The delta time of each tick as a double
The delta time of each tick as a float
The packet send rate
The packet send delta time
Gets the fixed tick time interval. Derived from the .
Use inside of FixedUpdateNetwork to determine if the tick currently being simulated has previously been simulated locally.
Resimulation occurs in client prediction when new states arrive from the StateAuthority.
Networked objects are set to the most current authority state tick, and simulations are repeated from that tick to the local current tick.
Use in conjunction with IsResimulation/IsForward inside of FixedUpdateNetwork to determine if the current tick being simulated
is the last tick of the resimulation or forward phase of the simulation loop.
'Resimulation' describes simulating a tick that has been previously been simulated.
'Forward' describes simulating a tick that is being simulated for the first time locally.
'Prediction' describes simulating ticks higher than the most current known StateAuthority snapshot tick.
Use in conjunction with IsResimulation/IsForward inside of FixedUpdateNetwork to determine if the current tick being simulated
is the first tick of the resimulation or forward phase of the simulation loop.
'Resimulation' describes simulating a tick that has been previously been simulated.
'Forward' describes simulating a tick that is being simulated for the first time locally.
'Prediction' describes simulating ticks higher than the most current known StateAuthority snapshot tick.
Use inside of FixedUpdateNetwork to determine if the tick currently being simulated has NOT previously been simulated locally.
True if the current stage of the simulation loop is Forward. False during resimulations.
'Resimulation' describes simulating a tick that has been previously been simulated.
'Forward' describes simulating a tick that is being simulated for the first time locally.
'Prediction' describes simulating ticks higher than the most current known StateAuthority snapshot tick.
The tick associated with the current state of networked objects, or the current simulation tick being processed (when evaluated during FixedUpdateNetwork).
The previous tick
The current simulation time in seconds
The current input collection size
Indicates if a Server/Client or Shared Mode (relay server) topology is being used.
Gets the flags for The type of network peer this simulation represents.
Gets the current value.
The file used by this .
The file used by this .
Remote Interpolation Alpha
Remote previous Tick
Remote Tick
If this peer is a client. True for client peers in Server/Client topologies, and true for all peers in Shared Mode.
If this peer is the server. True for the Server or Host peer in Server/Client topologies, and always false for all peers in Shared Mode (the relay is the server).
True for any peer that represents a human player. This is true for all peers except a dedicated server.
Indicates that this simulation is operating in Single Player mode, which is a Host that accepts no connections.
Only valid in Shared Mode. Indicates if this peer is flagged as the MasterClient, which means it is default StateAuthority
List of Active players in the Simulation
Signal if the Simulation is currently running
Bound Address of the internal socket
Current
Get LocalPlayer PlayerRef
Callback invoked After the Simulation Update
Callback invoked on the Connected
Connection that was connected
Callback invoked on the Disconnected
Connection that was disconnected
Reason for the disconnection
Callback invoked when the Network Receive is completed
Callback invoked when there is no simulation
Callback invoked before the Simulation Loop
Total number of re-simulations
Callback invoked before the First Tick
Add or remove specific player interest in a NetworkObject.
Try to get the Host Player
Host Player
True if the Host Player was found, false otherwise
Check if a NetworkObject is interested by a specific Player
NetworkObject to check
Player to check
True if the Player is interested in the NetworkObject, false otherwise
Check if a Player is the Input Authority over an NetworkObject
NetworkObject to check
Player to check
True if the Player is the Input Authority over the NetworkObject, false otherwise
Check if a Player is the State Authority in relation to another Player
State Source Player
Player to check
True if the Player is the State Authority, false otherwise
Check if a Player is the State Authority over a NetworkObject
NetworkObject to check
Player to check
True if the Player is the State Authority, false otherwise
Check if a Player is the State Authority over a NetworkObject
NetworkObject to check
Player to check
True if the Player is the State Authority, false otherwise
Check if the Local Player is the State Authority or Input Authority over a NetworkObject
NetworkObject to check
True if the Player is the State Authority or Input Authority, false otherwise
Check if the Local Player is the Input Authority over a NetworkObject
NetworkObject to check
True if the Player is the Input Authority, false otherwise
Check if the Local Player is the State Authority over a NetworkObject
NetworkObject to check
True if the Player is the State Authority, false otherwise
Check if a Player is the State Authority over a NetworkObject by NetworkId
NetworkId of the NetworkObject to check
True if the Player is the State Authority, false otherwise
Get the Input Authority PlayerRef for a NetworkObject
NetworkObject to check
PlayerRef of the Input Authority for the NetworkObject
Get the State Authority PlayerRef for a NetworkObject
NetworkObject to check
PlayerRef of the State Authority for the NetworkObject
Return a copy if a Player's Connection Token
Player to check for the Connection Token
Connection Token Copy
Return the Address of a remote Player
Player to check for the NetAddress
NetAddress of a specific player
Return the UniqueId as a long from a specific Player
Player to check for the UniqueId
UniqueId of a specific Player
Get the Simulation Input for a specific Player
Player to check for the Simulation Input
Simulation Input for a specific Player
Signal if the Server has any Active Connection with any number of Clients.
True, if at least one connection is active, false otherwise.
Callback invoked before the Simulation Update
Callback invoked after the Simulation Update
Forwards the Simulation based on the Delta Time
Delta Time used to forward the simulation
How many Ticks executed on this Update
Returns the number of objects in the simulation.
Returns a map of all objects in the simulation.
Enqueue a on the Out Message List for a specific
Message to enqueue
Target Connection
Disconnect a client based on it's NetAddress
Client Adress to Disconnect
Dispose Host Migration data
Process the serialized data from the bytebuffer into a organized Dictionary of NetIDs=NO Snapshots
Data buffer to read the data from
Target dictionary that will be filled with NetworkObjects data
Allocator used to create new
Result flags for the RPC message send operation.
Invalid result.
Client sent to the server, server will send to the target client.
Server sent to a specific client (a targeted message).
Server attempted to send to all the clients and at least one succeeded.
Target object not confirmed on the client.
Target object not in client's interest. Likely due to being outside of player's AOI region, or needs to be explicitly set as always interested.
Target client not connected (a targeted message).
Server attempted to send to all the clients, but none was connected.
Server attempted to send to all the clients, but the target object is not confirmed/not in Object Interest for all target clients.
Mask for sent messages.
Mask for not sent messages.
Mask for broadcast messages.
Mask for culled messages.
Classic server and client model
Relay based shared world model
Project configuration settings specific to how the Simulation class behaves.
Send delta compressed and redundant input, used for most games
Send redundant input, use for games with small input structs (like fps games) and high player count
Only send latest input state, useful for VR, etc.
When a 's data changes, the server will send all properties
whose changes have not been acknowledged.
This option consumes more bandwidth, but guarantees that each
has consistent state.
When a 's data changes, the server will only send the newly
changed properties.
This option consumes less bandwidth, but a may have
inconsistent state at times (some properties up-to-date but not others).
Input Data Word Count
Features to enabled to replication such as area of interest, etc.
Signal if scheduling is enabled
Signal if AOI is enabled
Signal if scheduling is running without AOI
The way which input is transferred
How the server chooses to send updates to balance consistency and bandwidth consumption.
The default number of players allowed to join a game instance. Can also be changed in code when starting Fusion.
The default tick rate to use. Can also be changed in code when starting Fusion.
The topology used
If, in host mode, we should allow host migration if the current host leaves.
Memory Heap Settings
Default size of each Heap Page
Default number of Heap Pages
Heap Global Size
Initializes and creates a new based on the Global Size
ToString
Main network configuration class.
Flag for allowed Reliable Data transfer modes.
Allow Client to Server.
Allow Client to Client using Server as Proxy.
Size in Kilobytes of the underlying socket send buffer.
Size in Kilobytes of the underlying socket receive buffer.
Max number of connection attempts that a Client will run when trying to connect to a remote Server.
Interval in seconds between each connection attempt from a Client.
Default assumed RTT in seconds for new connections (before actual RTT has been determined). The real RTT is calculated over time once the connection is established.
Max allowed time in seconds that the local peer can run without receiving any update from a remote peer.
If a client does not receive any update from the server within this period, it will disconnect itself.
If a server does not receive any update from a remote client within this period, it will disconnect that particular client.
Interval in seconds between PING messages sent to a remote connection, in order to keep that connection alive.
Currently unused.
Default delay between connection changes status to Shutdown (disconnected/invalid), and it actually being released (freeing all references to that particular connection).
Max number of bytes that can be used by Fusion to fill up a UDP package.
Current mode.
Initializes and creates a copy of this .
A copy of this .
Convert this into a using the as reference.
Configuration for network conditions simulation (induced latency and loss).
If adverse network conditions are being simulated.
The pattern used to oscillate between and values.
The lowest packet delay value returned from the oscillator.
The highest packet delay value returned from the oscillator.
The period of the oscillator (the rate at which delay oscillates in seconds).
The oscillates between 0 and 1. Values below this threshold are reduced to zero, resulting in a value equal to .
After the delay value from the oscillator is determined, random 0 to this value of additional seconds be added to the packet latency.
The pattern used to oscillate between and values.
The lowest loss chance value the oscillator will produce. 0 = 0% chance of being lost. 1 = 100% chance of being lost.
The highest loss chance value the oscillator will produce. 0 = 0% chance of being lost. 1 = 100% chance of being lost.
The wave oscillates between 0 and 1. Values below this threshold are reduced to zero, resulting in a value equal to .
The period of the oscillator (the rate at which delay oscillates between and ).
After the oscillation loss chance is calculated, an additional random value of 0 to this (normalized) percentage of loss chance is added.
Creates a copy of this .
Creates a new based on the current configuration.
A new based on the current configuration.
Time Synchronization Configuration
How big of a window the client looks at to evaluate the latest network conditions.
Increasing this makes the client slower to adapt to changes.
The maximum percentage of inputs that should ever arrive late because of jitter.
Decreasing this increases the client's simulation offset.
The maximum percentage of snapshots that should ever arrive late because of jitter.
Decreasing this increases the client's interpolation delay.
The number of consecutive, additional chances each input should have to reach the server before it's needed.
Increasing this increases the client's simulation offset.
The number of consecutive snapshots a client should be able to miss without disrupting their interpolation.
Increasing this increases the client's interpolation delay.
The maximum percentage the client's simulation can speed up or slow down
to maintain its target simulation offset.
The maximum percentage the client's interpolation can speed up or slow down
to maintain its target interpolation delay.
Simulation Connection Statistics
Simulation Input
Buffer for s.
Number of inputs in the buffer.
Whether the buffer is full.
Creates a new .
Network project configuration.
Clears the buffer.
Copies the buffer to an array and sorts it.
Array to copy to.
Number of elements copied.
Whether the buffer contains an input for .
Tick to check.
Whether the buffer contains an input for .
Removes an input for from the buffer.
Tick to remove.
Removed input.
Whether an input was removed.
Gets the insert time for .
Tick to get insert time for.
Insert time for .
Gets the input for .
Tick to get input for.
Input for .
Retrieves the last used input header data.
The last used input header data.
Adds an input to the buffer.
Input to add.
Insert time for .
Whether the input was added.
Player that owns this input.
Header for this input.
Data for this input.
Simulation input sent count.
Clear a total of words from this input.
Word count to clear.
Copy words from to this input.
Input to copy from.
Word count to copy.
Simulation Input Header
Word count of the header.
Size of the header.
Tick of the input.
Interpolation alpha of the input.
Interpolation from tick of the input.
Interpolation to tick of the input.
Simulation Message
SimulationMessage size in bytes.
Max user message size in bytes.
Flag for user messages.
Flag for remote messages.
Flag for static messages.
Flag for unreliable messages.
Flag for targeted messages to a player.
Flag for targeted messages to the server.
Flag for internal messages.
Flag for messages that are not tick aligned.
Flag for dummy messages.
Flag for user flags.
Flag for reserved flags.
Flag for reserved bits.
Tick of this
Source Player of this
Capacity in Bits of this
Current offset in Bits
Reference Count
Flags
Target Player of this
Add a reference to this
Subtract a reference from this
True if the reference count is now 0
Set the player target of this
Target Player
Set this as Static
Set this as Unreliable
Set this as Not Tick Aligned
Set this as Dummy
Get if a flag is set on this
Flag to check
True if the flag is set
Signal if this is Targeted
True if this is Targeted
Signal if this is Unreliable
Create a copy of a
to allocate from
to copy
Copy of the
Write a NetworkId to a
SimulationMessage to write to
NetworkId to write
Read a NetworkId from a
SimulationMessage to read from
NetworkId read
Write a Vector3 to a
SimulationMessage to write to
Vector3 to write
Read a Vector3 from a
SimulationMessage to read from
Vector3 read
Write a int to a
SimulationMessage to write to
int to write
Read a int from a
SimulationMessage to read from
int read
Get the byte pointer content of a
SimulationMessage to get the byte pointer of
Byte pointer of the
Allocate a new
Simulation to get the Memory from
Size in bytes of the new
Pointer to the new
Checks if a message with given size can be allocated.
Simulation Message ToString
Simulation Message ToString
Simulation Message Pointer
Pointer to the message.
Flags for The type of network peer a simulation represents.
Simulation represents a server peer, with no local player.
Simulation represents a server peer, with a local player.
Simulation represents a client peer, with a local player.
Stores the runtime configuration of the simulation
Current tick rates and send rates for server and client
Current Simulation Mode
Current player count
Current master client (in shared mode)
Current master client (in shared mode)
Current master client (in shared mode)
Flags for which stage the simulation currently running. Forward is when a tick is being simulated for the first time.
Resimulate is when a tick is being simulated again with corrections.
Currently simulating a tick for the first time.
Currently simulating a previously simulated tick again, with state corrections.
Simulation Stats
Time Resets
The number of re-simulations per Fusion simulation loop cycle.
The number of forward simulation steps
Engine Delta
Engine Spawn Queue Size
Round Trip Time
Player Count
Output Packets
Output Bandwidth
Input Packets
Input Bandwidth
Objects Count
Object Global Count
Object Predicted Count
Simulation Speed
Simulation Time Offset
Simulation Time Offset Target
Simulation Time Offset Deviation
Input Receive Delta
Input Receive Delta Deviation
State Receive Delta
State Receive Delta Deviation
Interpolation Speed
Interpolation Offset
Interpolation Offset Target
Interpolation Offset Deviation
Reduces errors at a constant rate using an on-off controller.
Reduces errors at a variable rate using a PID controller.
Network Physics
Word Count
Total Size
Time Scale
Base interface for all Fusion Network Structs
Utility methods for
Get the max word count from all registered types
Get Type Word Count if it is of type
Type to check for word count
Number of words for the
Get the Key associate with the argument Type
Type to check for the key
Associated Type Key, or an exception if not found
Get the Type based on its associate Key
Key associated with a Type
Type associated with the Key, or null otherwise
NetworkInput Struct
Number of Words for the
Data pointer of the
Signal if the is valid or not
Get the Type associated with this
Tries to export data as the indicated T struct.
Tries to import data from a struct.
Gets the content of this as another type
Sets the content of this to another type
Converts the Type of this to another type
Checks if this is of a certain type
Utility methods for
Get Word Count
type reference
Number of Words necessary for this specific