diff --git a/Assets/Photon/Fusion/Assemblies/Fusion.Common.dll b/Assets/Photon/Fusion/Assemblies/Fusion.Common.dll index 1f022a9b10..a7d3074275 100644 Binary files a/Assets/Photon/Fusion/Assemblies/Fusion.Common.dll and b/Assets/Photon/Fusion/Assemblies/Fusion.Common.dll differ diff --git a/Assets/Photon/Fusion/Assemblies/Fusion.Common.dll.debug b/Assets/Photon/Fusion/Assemblies/Fusion.Common.dll.debug index 8bc316a996..28788c4a98 100644 Binary files a/Assets/Photon/Fusion/Assemblies/Fusion.Common.dll.debug and b/Assets/Photon/Fusion/Assemblies/Fusion.Common.dll.debug differ diff --git a/Assets/Photon/Fusion/Assemblies/Fusion.Common.pdb.debug b/Assets/Photon/Fusion/Assemblies/Fusion.Common.pdb.debug index fefeaf8430..c2a80adb1d 100644 Binary files a/Assets/Photon/Fusion/Assemblies/Fusion.Common.pdb.debug and b/Assets/Photon/Fusion/Assemblies/Fusion.Common.pdb.debug differ diff --git a/Assets/Photon/Fusion/Assemblies/Fusion.Common.xml b/Assets/Photon/Fusion/Assemblies/Fusion.Common.xml index c643ad5d56..7a02df24a8 100644 --- a/Assets/Photon/Fusion/Assemblies/Fusion.Common.xml +++ b/Assets/Photon/Fusion/Assemblies/Fusion.Common.xml @@ -40,7 +40,7 @@ Set the Async Operation as faulted using the Exception - + Exception to be set on the Operation @@ -159,8 +159,8 @@ Register a callback for a specific Message Type - - + Message Type + Callback to be invoked when a Message of type T is received diff --git a/Assets/Photon/Fusion/Assemblies/Fusion.Common.xml.meta b/Assets/Photon/Fusion/Assemblies/Fusion.Common.xml.meta index a004565e6b..36f6509ddb 100644 --- a/Assets/Photon/Fusion/Assemblies/Fusion.Common.xml.meta +++ b/Assets/Photon/Fusion/Assemblies/Fusion.Common.xml.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 64b5744218cf4174d806db244249440e +guid: 7d64766e6fe68524b940b18b85691ad1 labels: - FusionCodeDoc TextScriptImporter: diff --git a/Assets/Photon/Fusion/Assemblies/Fusion.Log.dll b/Assets/Photon/Fusion/Assemblies/Fusion.Log.dll index b9efc190ac..f7a8c18f03 100644 Binary files a/Assets/Photon/Fusion/Assemblies/Fusion.Log.dll and b/Assets/Photon/Fusion/Assemblies/Fusion.Log.dll differ diff --git a/Assets/Photon/Fusion/Assemblies/Fusion.Log.dll.debug b/Assets/Photon/Fusion/Assemblies/Fusion.Log.dll.debug index b9efc190ac..f7a8c18f03 100644 Binary files a/Assets/Photon/Fusion/Assemblies/Fusion.Log.dll.debug and b/Assets/Photon/Fusion/Assemblies/Fusion.Log.dll.debug differ diff --git a/Assets/Photon/Fusion/Assemblies/Fusion.Log.dll.debug.meta b/Assets/Photon/Fusion/Assemblies/Fusion.Log.dll.debug.meta index 812c307c4d..df1e4b7002 100644 --- a/Assets/Photon/Fusion/Assemblies/Fusion.Log.dll.debug.meta +++ b/Assets/Photon/Fusion/Assemblies/Fusion.Log.dll.debug.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: ed698868f5125f54291916982c758f1c +guid: 2292511460dc62347a7cbeaf78a7a0be DefaultImporter: externalObjects: {} userData: diff --git a/Assets/Photon/Fusion/Assemblies/Fusion.Log.dll.meta b/Assets/Photon/Fusion/Assemblies/Fusion.Log.dll.meta index e1e54d5626..a15bd5b4c6 100644 --- a/Assets/Photon/Fusion/Assemblies/Fusion.Log.dll.meta +++ b/Assets/Photon/Fusion/Assemblies/Fusion.Log.dll.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: e429322ff96a8874dbc08cfa5f484727 +guid: e4be1beced0d30f4583f37e24f258d11 PluginImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Photon/Fusion/Assemblies/Fusion.Realtime.dll b/Assets/Photon/Fusion/Assemblies/Fusion.Realtime.dll index f010cc668b..fc2dd02ead 100644 Binary files a/Assets/Photon/Fusion/Assemblies/Fusion.Realtime.dll and b/Assets/Photon/Fusion/Assemblies/Fusion.Realtime.dll differ diff --git a/Assets/Photon/Fusion/Assemblies/Fusion.Realtime.dll.debug b/Assets/Photon/Fusion/Assemblies/Fusion.Realtime.dll.debug index 5f2e8209d9..9207783cf7 100644 Binary files a/Assets/Photon/Fusion/Assemblies/Fusion.Realtime.dll.debug and b/Assets/Photon/Fusion/Assemblies/Fusion.Realtime.dll.debug differ diff --git a/Assets/Photon/Fusion/Assemblies/Fusion.Realtime.pdb.debug b/Assets/Photon/Fusion/Assemblies/Fusion.Realtime.pdb.debug index 9373f976b1..e708783fdf 100644 Binary files a/Assets/Photon/Fusion/Assemblies/Fusion.Realtime.pdb.debug and b/Assets/Photon/Fusion/Assemblies/Fusion.Realtime.pdb.debug differ diff --git a/Assets/Photon/Fusion/Assemblies/Fusion.Realtime.xml b/Assets/Photon/Fusion/Assemblies/Fusion.Realtime.xml index 194221a590..bc349005f8 100644 --- a/Assets/Photon/Fusion/Assemblies/Fusion.Realtime.xml +++ b/Assets/Photon/Fusion/Assemblies/Fusion.Realtime.xml @@ -114,7 +114,7 @@ Change the Custom Properties of the current Room - New set of Custom Properties + New set of Custom Properties True if the change was made, false otherwise @@ -160,7 +160,7 @@ - Convert a into a pair of and respectively + Convert a into a pair of and respectively representing the custom properties of a session and the property names that will be published on the Lobby Dictionary to be converted @@ -184,15 +184,17 @@ - Runs reconnect and rejoin. + Asynchronously reconnects and rejoins a room. - Client object - Runs client.Service() during the operation - Returns when inside the room - Is thrown when the connection terminated - Is thrown when the operation could not be started - Is thrown when the operation completed unsuccessfully - Is thrown when the operation timed out + The client that is reconnecting and rejoining. + Indicates whether to throw an exception on error. Defaults to true. + Indicates whether to run the client's service during the operation. Defaults to true. + An optional cancellation token that can be used to cancel the operation. Defaults to an empty cancellation token. + A task that represents the asynchronous operation. The task result is a boolean indicating whether the operation was successful. + Thrown when the client is still connected or when the reconnecting operation fails to start. + Thrown when the connection is terminated during the operation. + Thrown when the operation completes unsuccessfully. + Thrown when the operation times out. @@ -200,6 +202,7 @@ Client. Runs client.Service() during the operation + Optional external cancellation token Returns when the client has successfully disconnected Is thrown when the connection terminated Is thrown when the operation could not be started @@ -214,6 +217,7 @@ Enter room params Set ErrorCode as result on RoomCreateFailed or RoomJoinFailed Runs client.Service() during the operation + Optional external cancellation token When the room has been entered Is thrown when the connection terminated Is thrown when the operation could not be started @@ -316,12 +320,12 @@ - Convert a into a + Convert a into a - Convert a into a + Convert a into a @@ -333,14 +337,14 @@ - Convert the Room Custom Properties into a + Convert the Room Custom Properties into a RoomInfo to extract the custom properties - with the data + with the data - Calculate the total size a would take when serialized + Calculate the total size a would take when serialized Dictionary to check the size Total size of the Dictionary in serialized format @@ -4498,7 +4502,7 @@ Accompanies Equals, using the name's HashCode as return. - + HashCode of the name. Returns most interesting room values as string. @@ -4679,7 +4683,7 @@ The photon settings class, which is wrapped by this ScriptableObject. - + Serialized server settings, written by the Setup Wizard for use in ConnectUsingSettings. diff --git a/Assets/Photon/Fusion/Assemblies/Fusion.Realtime.xml.meta b/Assets/Photon/Fusion/Assemblies/Fusion.Realtime.xml.meta index 27a189cc75..39d34359ad 100644 --- a/Assets/Photon/Fusion/Assemblies/Fusion.Realtime.xml.meta +++ b/Assets/Photon/Fusion/Assemblies/Fusion.Realtime.xml.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 6495aaf620c227240903d14629259bce +guid: 5b8ad12613fe58446a82e2950a2f0c8d labels: - FusionCodeDoc TextScriptImporter: diff --git a/Assets/Photon/Fusion/Assemblies/Fusion.Runtime.dll b/Assets/Photon/Fusion/Assemblies/Fusion.Runtime.dll index ad45b06209..1a685c5100 100644 Binary files a/Assets/Photon/Fusion/Assemblies/Fusion.Runtime.dll and b/Assets/Photon/Fusion/Assemblies/Fusion.Runtime.dll differ diff --git a/Assets/Photon/Fusion/Assemblies/Fusion.Runtime.dll.debug b/Assets/Photon/Fusion/Assemblies/Fusion.Runtime.dll.debug index bfa2886252..584ff502f8 100644 Binary files a/Assets/Photon/Fusion/Assemblies/Fusion.Runtime.dll.debug and b/Assets/Photon/Fusion/Assemblies/Fusion.Runtime.dll.debug differ diff --git a/Assets/Photon/Fusion/Assemblies/Fusion.Runtime.pdb.debug b/Assets/Photon/Fusion/Assemblies/Fusion.Runtime.pdb.debug index ee6dd1eed0..614c5425c6 100644 Binary files a/Assets/Photon/Fusion/Assemblies/Fusion.Runtime.pdb.debug and b/Assets/Photon/Fusion/Assemblies/Fusion.Runtime.pdb.debug differ diff --git a/Assets/Photon/Fusion/Assemblies/Fusion.Runtime.xml b/Assets/Photon/Fusion/Assemblies/Fusion.Runtime.xml index 7bf59364e5..a129326070 100644 --- a/Assets/Photon/Fusion/Assemblies/Fusion.Runtime.xml +++ b/Assets/Photon/Fusion/Assemblies/Fusion.Runtime.xml @@ -4,6 +4,29 @@ 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 @@ -13,2073 +36,4533 @@ If size is less than 1 If size is bigger than - + - Page Bit Shift Lookup Table + Memory Allocator Configuration - + - Additional companion attribute to NetworkedAttribute, which indicates how floats should be compressed. + Config Size - + - Constructor new accuracy. + Default Block Shift - + - Constructor new accuracy. + Default Block Count - + - Constructor that takes a named constant. - Accuracy for this property will be acquired from the settings. + Block Shift Config value - - + - - 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. - OnChanged can be assigned with the name of a method in the same NetworkBehaviour. - The named method will get called whenever this property value has been changed by the State Authority. - - | [Networked(OnDataReceived = nameof(MyCallbackMethod)]

- | public int MyProperty { get; set; } - | - | protected static void MyCallbackMethod(Changed<ChangedCallbackParent> changed) { - | changed.LoadNew(); - | var newval = changed.Behaviour.MyProperty; - | changed.LoadOld(); - | var oldval = changed.Behaviour.MyProperty; - | Debug.Log($"Changed from {oldval} to {newval}"); - | } -
-
- - 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 { } } -
-
+ Block Count Config value
- + - Name of the field that holds the default value for this networked property. + Globals Size Config value - + - Default constructor for NetworkedAttribute + Block Size in Bytes - + - 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. + Block Size in Words - + - Describes the total number of WORDs a uses. + Heap Size in Bytes - + - Enables a special inspector drawer for Unity Rect type, specially designed for editing RectTransforms using normalized values. + Heap Size Allocated in Bytes - + - Constructor for . InvertY inverts Y handling, for RectTransforms which treat lowerRight as origin, rather than upper left. + Config Constructor - - 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. + Block Shift + Block Count + Globals Size - + - Override default render settings for [Networked] properties. + Check Config equality + Config Ref + True if has the same values - + - - Force this property to be rendered in this . - - - This setting is prioritized over and overrides. - + Check Config equality + Any object reference + True if obj is a and has the same values - + - - Force this property to be rendered using this (in the chosen ). - - - This setting is prioritized over and overrides. - + Get Hash Code + Hash Code - + - - Override the default interpolation method for this property. The method's signature must match: - - - static T MethodName(T from, T to, float alpha) { /* ... */ } - + Config ToString - + - Default constructor for RenderAttribute + Page Bit Shift Lookup Table - + - Wrapper around the Fusion LBC Implementation - - It will control and manage the communication between Fusion and the Photon Cloud + Ptr - + - Fusion LBC Client Reference + Ptr Equality Comparer - + - ID of this Communicator. This reflects the Actor Number of the Peer inside the Room + Ptr Equality Comparer + Ptr X + Ptr Y + True if point to the same Address - + - Flag to signal if this Communicator was extracted and will be reused + Get Hash Code + Ptr + Ptr Address - + - Responsible to deal with LoadBalancingClient Events + Ptr Size + + - 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 + Null Ptr - + - Signal if the local peer is connected to the Photon Cloud and can perform extra actions, like creating/joining a Room. + Ptr Address - + - Photon Client UserID + Check Ptr equality + Ptr Ref + True if points to the same Address - + - Signal if the local peer is already inside a Room + Check Ptr equality + Any object reference + True if obj is a and points to the same Address - + - Signal if the local peer is already inside a Lobby + Hash Code, same as + - + - Current Fusion Session Join Stage + to String + in Hexadecimal format - + - Current ProtocolMessageVersion + Implicit Bool Operator + Check if is not 0 + + to check + + + True if is not 0 + - + - Max Number of players a Session can handle + Implicit Ptr Equals Operator + + A + + + B + + + True if is the same + - + - Signal if the local peer is also the Master Client of the Current Room + Implicit Ptr Not Equals Operator + + A + + + B + + + True if is not the same + - + - Get the internal used by the Client to perform the authentication + Implicit Ptr Sum Operator + + to add to + + + Value to add + + + with increased by + - + - Reference to the current active communicator + Implicit Ptr Subtraction Operator + + to subtract from + + + Value to subtract + + + with decreased by + - + - Get the local client cached region summary + Capacity Attribute - + - Signal if the local peer will try or accept connections using NAT Punch + Total Capacity - + - Custom STUN Server + CapacityAttribute Constructor + - + + + Default For Property Attribute + + For non-serialized properties + + + - Exposes the current NAT Type from the local Peer + Property Name - + - player ref assigned by the cloud + Property Word Offset - + - Builds a new CloudService reference + Property Word Count - Reference to the current active Runner - - Optional external Communicator - + - Extract the internal Communicator for later re-use + DefaultForPropertyAttribute Constructor - Current used by this instance with all resetted settings + + + - + - Update and perform all pending actions related to the Photon Cloud communication + Fixed Buffer Property Attribute - + - Connect the local peer to Photon Cloud using an async process. + Fixed Buffer Type - 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 + Fixed Buffer Surrogate Type - 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. + Fixed Buffer Capacity - 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 + FixedBufferPropertyAttribute Constructor - ActorID of a Player inside the Room - Player UserID + + + - + - Try to get the ActorId associated with a specific Client Unique Id + Network Assembly Ignore Attribute - 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 + Network Assembly Weaved Attribute - Current attempt number - Max number of attempts - Flag if target EndPoint should change - New target EndPoint - + - Start the connection process with a Remote Server + Network Behaviour Weaved Attribute - Starting NAT Punch state, see for more info - Remote Server EndPoint to connect to - + - Disposes the current + Word Count - + - Callback invoked when any Room Property has changed + NetworkBehaviourWeavedAttribute Constructor + - + - Callback invoked when the Room list is updated with data from the Cloud + Network Deserialize Method Attribute - New List of - + - Send a Protocol Message to Fusion Plugin + + 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. + OnChanged can be assigned with the name of a method in the same NetworkBehaviour. + The named method will get called whenever this property value has been changed by the State Authority. + + | [Networked(OnDataReceived = nameof(MyCallbackMethod)]

+ | public int MyProperty { get; set; } + | + | protected static void MyCallbackMethod(Changed<ChangedCallbackParent> changed) { + | changed.LoadNew(); + | var newval = changed.Behaviour.MyProperty; + | changed.LoadOld(); + | var oldval = changed.Behaviour.MyProperty; + | Debug.Log($"Changed from {oldval} to {newval}"); + | } +
+
+ + 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 { } } +
+
- Optional external cancellation token
- + - Send a Protocol Message to the Fusion Plugin + Name of the field that holds the default value for this networked property. - Reference to the Project Config to be sent - + - Send a Protocol Message to the Fusion Plugin + Default constructor for NetworkedAttribute - Reference to StunResult used to build the Protocol Message - - - Build and send the latest Server Snapshot to the Fusion Plugin - + + + Networked Weaved Attribute + + Networked Property Attribute + - + - Handles a Confirmation Protocol Message sent by the Fusion Plugin + Networked Property Word Offset - Sender Actor Number - Join Protocol Message - + - Handles a Protocol Message sent by the Fusion Plugin + Networked Property Word Count - Sender Actor Number - Start Protocol Message - + - Handles a Protocol Message sent by the Fusion Plugin + NetworkedWeavedAttribute Constructor - Sender Actor Number - Disconnect Protocol Message + + - + - Handles a Protocol Message sent by the Fusion Plugin + Network Input Weaved Attribute - Sender Actor Number - NetworkConfigSync Protocol Message - + - Handles a Protocol Message sent by the Fusion Plugin + Word Count - Sender Actor Number - ReflexiveInfo Protocol Message - + - Confirms or waits for confirmation from the Plugin of the Join Message + NetworkInputWeavedAttribute Constructor - True if the Join Confirmation was received, false otherwise + - + - Send an empty message to Photon Cloud so the LBC Connection keeps alive + Network Prefab Attribute - + - + Network Rpc Static Weaved Invoker Attribute + Contains info about a static weaved RPC Method - - + - 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 + RPC Key - Remove EndPoint to ping - + - Run the STUN Service to retrieve the current Reflexive Addresses of the local peer + NetworkRpcStaticWeavedInvokerAttribute Constructor - Running Task of the STUN Query Procedure + - + - Update the internal used to start the Fusion Runner + Network Rpc Weaved Invoker Attribute + Contains info about a weaved RPC Method - New arguments - + - Check if Remote Private EndPoint appears to be in the same Subnet + RPC Key - True if in same Subnet - + - Initilize the Log system from the Realtime SDK to use the Fusion Log System + RPC Sources - + - Converts a to a + RPC Targets - - 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 + NetworkRpcWeavedInvokerAttribute Constructor + + + - + - Client Server Lobby + Network Serialize Method Attribute - + - Shared Lobby + 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. - + - Reference to the initialization arguments set by the user. - They are used to start the Fusion Runner + Describes the total number of WORDs a uses. - + - Connection Stage related to the current EndPoint Type used by the client to connect a remote server + Word Count - + - Describes the current state of the Join process + If the is Generic Composite - + - Describe the current protocol version we are using to communicate with the Plugin + NetworkStructWeavedAttribute Constructor + word count - + - Remote Server Reflexive Info. Stores private and public EndPoint of the remote server. + Enables a special inspector drawer for Unity Rect type, specially designed for editing RectTransforms using normalized values. - + - Local Reflexive Info. Stores private and public EndPoint of the local peer. + Signal if Y should be inverted - + - Stores the local peer Unique Id + Set the Aspect Ratio - + - Stores the local peer Unique Id + 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. - + - Stores requests sent by the plugin + Preserve In Plugin Attribute - + - Last Disconnect Msg Received from the Plugin + PreserveInPluginAttribute Constructor - + - Mapping between Actor UniqueId and its ReflexiveInfo + Override default render settings for [Networked] properties. - + - Define a list of Requests that may be asked by the Plugin Server + + Force this property to be rendered in this . + + + This setting is prioritized over and overrides. + - + - No Request + + Force this property to be rendered using this (in the chosen ). + + + This setting is prioritized over and overrides. + - + - Request for the Local Reflexive Info + + Override the default interpolation method for this property. The method's signature must match: + + + static T MethodName(T from, T to, float alpha) { /* ... */ } + - + - Describes the current Target Address Type used in the NAT Punch procedure + Default constructor for RenderAttribute - + - No connection procedure is running + RenderAttribute Constructor + reference + reference - + - Trying to Connect to LAN EndPoint + Render Weaved Attribute - + - Trying to Connect to WAN EndPoint + RenderWeavedAttribute Constructor - + - Trying to Connect to Relay EndPoint + Resolve Network Prefab Source Attribute - + - 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 + Unity ContextMenuItemAttribute - + - Join Request not sent yet + ContextMenuItemAttribute Order - + - Join Request Sent, waiting for confirmation + ContextMenuItemAttribute Constructor - + - Join Confirmation Received, all good + Unity DelayedAttribute - + - Failed to receive Join Confirmation after a timeout () + DelayedAttribute Order - + - 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. + Unity HeaderAttribute - + - Delay between pings + HeaderAttribute Order - + - Total number of pings to send + HeaderAttribute Constructor - + - Countdown for the next ping + Unity MinAttribute - + - Remote Client Reflexive Info, used to getter the Public EndPoint to send the ping + MinAttribute Order - + - Extension methods to + MinAttribute Constructor - + - Holds information about a Lobby + Unity MultilineAttribute - + - Flag to signal if the is ready for use. - This is only true if the peer is currently connected to a Lobby. + MultilineAttribute Order - + - Lobby Name + Unity NonReorderableAttribute - + - Stores the current connected Region + NonReorderableAttribute Order - + - Session Lobby Type + Unity RangeAttribute - + - Invalid Session Lobby Type + RangeAttribute Order - + - ClientServer Lobby + RangeAttribute Constructor - + - Shared Lobby + Unity SerializeField - + - Custom Lobby - works in conjuction with a Lobby Name/ID + Unity SerializeReference - + - Holds information about the Game Session + Unity SpaceAttribute - + - Flag to signal if the is ready for use + SpaceAttribute Order - + - Stores the current Room Name + SpaceAttribute Constructor - + - Stores the current connected Region + Unity TooltipAttribute - + - Signal if the current connected Room is visible + TooltipAttribute Order - + - Signal if the current connected Room is open + TooltipAttribute Constructor - + - Room Custom Properties + Unity NonSerializedAttribute - + - Current number of peers inside this Session, this includes the Server/Host and Clients + Unity FormerlySerializedAsAttribute - + - Max number of peer that can join this Session, this value always include an extra slot for the Server/Host + FormerlySerializedAsAttribute Constructor - + - Check if the reference is not Null and is Valid. + Weaver Generated Attribute - - + - Update or change the Custom Properties of the current joined Room + Wrapper around the Fusion LBC Implementation + + It will control and manage the communication between Fusion and the Photon Cloud - New custom properties - + - String representation of a + Fusion LBC Client Reference - Formatted - + - Interface for callback. - Called after the resimulation loop (when applicable), and also after the forward simulation loop. - Implement this interface on and classes. + ID of this Communicator. This reflects the Actor Number of the Peer inside the Room - + - Called after the resimulation loop (when applicable), and also after the forward simulation loop. - Only called on Updates where resimulation or forward ticks are processed. + Flag to signal if this Communicator was extracted and will be reused - True if this is being called during the resimulation loop. False if during the forward simulation loop. - How many resimulation 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. + Responsible to deal with LoadBalancingClient Events - - - Called at the very start of the resimulation loop (on clients with prediction enabled), - immediately after state is set to the latest server snapshot. + 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 - + - Used to mark NetworkBehaviors that need to be react after a Host Migration process + Signal if the local peer is connected to the Photon Cloud and can perform extra actions, like creating/joining a Room. - + - Invoked after the Host Migration happens in order to setup non-networked data on NetworkBehaviors + Photon Client UserID - + - Interface for callback. - Called after each tick simulation completes. - Implement this interface on and classes. + Signal if the local peer is already inside a Room - + - Called after each tick simulation completes. + Signal if the local peer is already inside a Lobby - + - Interface for the callback, which is called at the end of each Fusion Update segment. - Implement this interface on and classes. + Current Fusion Session Join Stage - + - Called at the end of the Fusion Update loop, before all Unity MonoBehaviour.Update() callbacks. + Current ProtocolMessageVersion - + - Interface for callback. - Called before the resimulation loop (when applicable), and also before the forward simulation loop. - Implement this interface on and classes. + Max Number of players a Session can handle - + - Called before the resimulation loop (when applicable), and also before the forward simulation loop. - Only called on Updates where resimulation or forward ticks are processed. + Signal if the local peer is also the Master Client of the Current Room - True if this is being called during the resimulation loop. False if during the forward simulation loop. - How many resimulation 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), - before state is set to the latest server snapshot. - Implement this interface on and classes. + Get the internal used by the Client to perform the authentication - + - Called at the very start of the resimulation loop (on clients with prediction enabled), - before state is set to the latest server snapshot. + Reference to the current active communicator - + - Interface for callback. - Implement this interface on and classes. + Get the local client cached region summary - + - Called immediately before the registers hitboxes in a snapshot. + Signal if the local peer will try or accept connections using NAT Punch - + - Interface for callback. - Called before each tick is simulated. - Implement this interface on and classes. + Custom STUN Server - + - Called before each tick is simulated. + Exposes the current NAT Type from the local Peer - + - Interface for the callback, which is called at the beginning of each Fusion Update segment. - Implement this interface on and classes. + player ref assigned by the cloud - + - Called at the start of the Fusion Update loop, before the Fusion simulation loop. + Builds a new CloudService reference + Reference to the current active Runner + Custom Photon App Settings + Optional external Communicator - + - Interface for callback. - Called when the joins AreaOfInterest. - Implement this interface on and classes. - Only applicable to . + Extract the internal Communicator for later re-use + Current used by this instance with all resetted settings - + - Called when the joins AreaOfInterest. - Object is now receiving snapshot updates. - Object will execute FixedUpdateNetwork() and Render() methods until the object leaves simulation. + Update and perform all pending actions related to the Photon Cloud communication - + - Interface for the callback. - Called when the leaves AreaOfInterest. - Implement this interface on and classes. - Only applicable to . + 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 - + - 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. + 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. - - - 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. - + + + 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 - + - Gives access to the offset (in 32 bit words) and count (in 32 bit words) of this behaviour backing data + 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 - + - The tick the data on this networked behaviour changed + Get the UserID of another Player Actor in the Room + ActorID of a Player inside the Room + Player UserID - + - The unique identifier for this network behaviour. + 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 - + - Returns true if the of the associated is the designated as Input Source for this network entity. + 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 - + - Returns true if the associated is the State Source for this network entity. + Start the connection process with a Remote Server + Starting NAT Punch state, see for more info + Remote Server EndPoint to connect to - + - 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. + Disposes the current - + - 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. + Callback invoked when any Room Property has changed - + - Returns true if the object is writable in the editor - i.e. when it is not attached - or has the state authority. + Callback invoked when the Room list is updated with data from the Cloud + New List of - + - Gets a bitmask of flags, representing the current local authority over this . + Send a Protocol Message to Fusion Plugin + Optional external cancellation token - + - Resets the state of the object to the original state + Send a Protocol Message to the Fusion Plugin + Reference to the Project Config to be sent - + - Copies entire state of passed in source + Send a Protocol Message to the Fusion Plugin - Source to copy data from + Reference to StunResult used to build the Protocol Message - + - Post spawn callback. + Build and send the latest Server Snapshot to the Fusion Plugin - + - Called before the network object is despawned + Handles a Confirmation Protocol Message sent by the Fusion Plugin - If the state of the behaviour is still accessible + Sender Actor Number + Join Protocol Message - + - Allows read and write access to the internal state buffer + Handles a Protocol Message sent by the Fusion Plugin - The offset to generate a ref for, in integer words - - Reference to the location in memory defined by offset + Sender Actor Number + Start Protocol Message - + - + Handles a Protocol Message sent by the Fusion Plugin - + Sender Actor Number + Disconnect Protocol Message - + - 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. + Handles a Protocol Message sent by the Fusion Plugin + Sender Actor Number + NetworkConfigSync Protocol Message - + - Converts NetworkBehaviour to NetworkBehaviourId + Handles a Protocol Message sent by the Fusion Plugin - - + Sender Actor Number + ReflexiveInfo Protocol Message - + - This method needs to be invoked in user overrides of: - - + Confirms or waits for confirmation from the Plugin of the Join Message + True if the Join Confirmation was received, false otherwise - + - This is a special method that is meant to be used only for [Networked] properties inline initialization. + Send an empty message to Photon Cloud so the LBC Connection keeps alive - + - This is a special method that is meant to be used only for [Networked] properties inline initialization. + 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. - + - Provides low level accesss to data buffers that can be read using a NetworkBehaviour.Reader + 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 - + - This method is not meant to be called directly. Calls are injected by the Weaver. + Run the STUN Service to retrieve the current Reflexive Addresses of the local peer - + Running Task of the STUN Query Procedure - + - This method is not meant to be called directly. Calls are injected by the Weaver. + Update the internal used to start the Fusion Runner - + New arguments - + - This method is not meant to be called directly. Calls are injected by the Weaver. + Check if Remote Private EndPoint appears to be in the same Subnet - + True if in same Subnet - + - 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. + Initilize the Log system from the Realtime SDK to use the Fusion Log System - + - The Animator being synced. If unset, will attempt to find one on this GameObject. + Converts a to a + + ref + Room Region + ref - + - The number of words allocated per snapshot for serialization of the Animator. (One Word is 32 bits, or 4 bytes). + Holds information about the local peer used to Join/Start/Connect to a remote Peer + using the Photon Cloud as backend - + - The source of the State which is applied in Render. + Client Server Lobby - + - Flags controlling which Mecanim data will be synced. + Shared Lobby - + - States found in the current AnimatorController, converted to hashes. + Reference to the initialization arguments set by the user. + They are used to start the Fusion Runner - + - Triggers found in the current AnimatorController, converted to hashes. + Connection Stage related to the current EndPoint Type used by the client to connect a remote server - + - 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). + Describes the current state of the Join process - - 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). + Describe the current protocol version we are using to communicate with the Plugin - - 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. + Remote Server Reflexive Info. Stores private and public EndPoint of the remote server. - + - The this component is associated with. + Local Reflexive Info. Stores private and public EndPoint of the local peer. - + - The this component is associated with. + Stores the local peer Unique Id - + - Fusion FixedUpdate timing callback. + Stores the local peer Unique Id - + - Post simulation frame rendering callback. Runs after all simulations have finished. Use in place of Unity's Update when Fusion is handling Physics. + Stores requests sent by the plugin - + - This is intentionally private; sub classes can create their own overload - without worrying about matching visibility etc. - calls will be weaved in. + 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 - + - 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)] - + No Request - + - Flag for which stages of the simulation loop this component will execute this script. + Request for the Local Reflexive Info - + - Flag for which indicated peers in will execute this script. + Describes the current Target Address Type used in the NAT Punch procedure - + - Flag for which topologies this script will execute in + No connection procedure is running - + - The default behaviour interfaces + Trying to Connect to LAN EndPoint - + - Use NetworkTransform (or any custom class derived from NetworkTRSP) to synchronize initial transform values. This component is non-functional. + Trying to Connect to WAN EndPoint - + - Use the Fusion Unity Physics Add-on, or your own variation of it to synchronize Rigidbodies. This component is non-functional. + Trying to Connect to Relay EndPoint - + - Use the Fusion Unity Physics Add-on, or your own variation of it to synchronize Rigidbodies. This component is non-functional. + 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 - + - Add to any Transform, or its associated child Transforms to automatically synchronize - TRSP (Position/Rotation/Scale/Parent). + Join Request not sent yet - + - Enables synchronization of LocalScale. + Join Request Sent, waiting for confirmation - + - 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. + Join Confirmation Received, all good - + - 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. + Failed to receive Join Confirmation after a timeout - + - Automatically sets the Area Of Interest Override for this NetworkObject to the parent NetworkObject. + 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. - + - 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(). + Delay between pings - + - 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. + Total number of pings to send - + - Manually set the used as the AreaOfInterestOverride. + Countdown for the next ping - - - - - - - - + - Implement this interface on a implementation to indicate it can be teleported. + Remote Client Reflexive Info, used to getter the Public EndPoint to send the ping - + - Teleports to the indicated values, and network the Teleport event. + Extension methods to - + - 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. + Holds information about a Lobby - + - The main is at the root of the - and it will be used for area of interest operations and parenting of the . + Flag to signal if the is ready for use. + This is only true if the peer is currently connected to a Lobby. - + - The networked data of this . + Lobby Name - + - A reference to the networked data of this . + Stores the current connected Region - + - Manually set the used as the AreaOfInterestOverride. + Session Lobby Type - - + - The default Teleport implementation for derived classes. + Invalid Session Lobby Type - + - Default handling for setting a 's parent using a NetworkBehaviourId value. + ClientServer Lobby - + - Recursively attempts to find nested parent NetworkObject, and if found assigns that NetworkObject as the AreaOfInterestOverride. + Shared Lobby - 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. + Custom Lobby - works in conjuction with a Lobby Name/ID - + - Data structure storing spatial (Position/Rotation/Scale/Parent) synchronization data for spatial synchronization components, and its subclass . + Holds information about the Game Session - + - Special NetworkBehaviourId value, used as a flag to tell the parent is a non-networked object + Flag to signal if the is ready for use - + - Networked properties word count for the base + Stores the current Room Name - + - The actual size for the networked properties in bytes + Stores the current connected Region - + - Offset to point at the position values on the data buffer + Signal if the current connected Room is visible - + - Id of a NetworkBehaviour on the parent of the component's transform. + Signal if the current connected Room is open - + - Position relevant for the spatial synchronization component (can be used to either store a local position or a world position, depending on the component) + Room Custom Properties - + - Rotation relevant for the spatial synchronization component (can be used to either store a local rotation or a world rotation, depending on the component) + Current number of peers inside this Session, this includes the Server/Host and Clients - + - Scale relevant for the spatial synchronization component + Max number of peer that can join this Session, this value always include an extra slot for the Server/Host - + - Key used to differentiate between several teleports + Check if the reference is not Null and is Valid. + Session Info - + - 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 + Update or change the Custom Properties of the current joined Room + New custom properties - + - 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. + String representation of a + Formatted - + - Find T on supplied transform or any parent. Unlike GetComponentInParent, GameObjects do not need to be active to be found. + Interface for callback. + Called after the re-simulation loop (when applicable), and also after the forward simulation loop. + Implement this interface on and classes. - + - 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. + 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. - + - Same as GetComponentInParent, but will always include inactive objects in search. - Will also stop recursing up the hierarchy when the StopOnT is found. + 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. - + - UNTESTED + Called at the very start of the resimulation loop (on clients with prediction enabled), + immediately after state is set to the latest server snapshot. - + - Finds components of type T on supplied transform, and every parent above that node, inclusively stopping on node StopT component. + Used to mark NetworkBehaviors that need to be react after a Host Migration process - + - Same as GetComponentsInChildren, but will not recurse into children with component of the StopT type. + Invoked after the Host Migration happens in order to setup non-networked data on NetworkBehaviors - + - Same as GetComponentsInChildren, but will not recurse into children with any component of the types in the stopOn array. + Interface for callback. + Called after the render loop. - + - Same as GetComponentsInChildren, but will not recurse into children with component of the StopT type. + Called after the render loop. - 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. + Interface for callback. + Called after the object is spawned. - + - 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. + Called after the object is spawned. - - - 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. + Interface for callback. + Called after each tick simulation completes. + Implement this interface on and classes. - The type being searched for. - Casts all found objects to this type, and returns collection of this type. Objects that fail cast are excluded. - - 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. + Called after each tick simulation completes. - - - - Supplied list that will be filled with found objects. - Whether results should include inactive components. - + - Call this to batch-optimize any object-changes notified through - ssBVHNode.refit_ObjectChanged(..). For example, in a game-loop, - call this once per frame. + Interface for the callback, which is called at the end of each Fusion Update segment. + Implement this interface on and classes. - + - Call this when you wish to update an object. This does not update straight away, but marks it for update when Optimize() is called + Called at the end of the Fusion Update loop, before all Unity MonoBehaviour.Update() callbacks. - - + - initializes a BVH with a given nodeAdaptor, and object list. + Interface for callback. + Called before the re-simulation loop (when applicable), and also before the forward simulation loop. + Implement this interface on and classes. - + - tryRotate looks at all candidate rotations, and executes the rotation with the best resulting SAH (if any) + 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. - + - Details regarding a shape intersection. - It does not carry information about the intersection happening or not. + 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. - + - Contact point. + Called at the very start of the re-simulation loop (on clients with prediction enabled), + before state is set to the latest server snapshot. - + - Vector that described the plane of smallest penetration between the shapes. + Interface for callback. + Called before the copy of the previous state. - + - Penetration along the normal plane. + Called before the copy of the previous state. - + - Checks if a sphere in the local space of an AABB intersects with it. + Interface for callback. + Implement this interface on and classes. - 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). + Called immediately before the registers hitboxes in a snapshot. - 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 + Interface for callback. + Called before each tick is simulated. + Implement this interface on and classes. - + - Get the node Bounds + Called before each tick is simulated. - + - Get the node depth on the BVH + Interface for the callback, which is called at the beginning of each Fusion Update segment. + Implement this interface on and classes. - + - Get the BVH max depth + Called at the start of the Fusion Update loop, before the Fusion simulation loop. - + - Container class to provide the necessary information to draw a hitbox collider + Interface for callback. + Called when a is despawned. - + - The of the collider. + Called when a is despawned. + NetworkRunner that despawned the . + Whether the has state. - + - The box extends of the collider - Used on of types: Box + Interface for handling the event when a player enters the area of interest. - + - The offset of the collider. + Method to be called when a player enters the area of interest. + The player who entered the area of interest. - + - The radius of the collider. - Used on of types: Sphere and Capsule. + Interface for handling the event when a player exits the area of interest. - + - The height for capsule colliders. - + Method to be called when a player exits the area of interest. + The player who exited the area of interest. - + - The local to world matrix of the collider. + Interface for handling the event when a local prefab is created. - + - Provide access to iterate over the lag compensation system components and give the necessary information to draw them. + Method to be called when a local prefab is created. - + - 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. + Interface for handling the event when a player joins the game. - + - Iterate over to get the BVH node draw data. + Method to be called when a player joins the game. + The player who joined the game. - + - Method to draw capsules out of simple shapes. + Interface for handling the event when a player leaves the game. - 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. + Method to be called when a player leaves the game. + The player who left the game. - + - Provide a way to iterate over the and return - the for each collider on the snapshot. + Interface for handling the event when a remote prefab is created. - + - Provide a way to iterate over BVH and return a for each node. + Method to be called when a remote prefab is created. - + - Queries can hit either fusion's custom or Unity's standard Physx/Box2D colliders. + Interface for handling the event when a scene load operation is completed. - + - Used when a raycast does not hit anything. Not used on overlaps. + Method to be called when a scene load operation is completed. + The information about the loaded scene. - + - is a Fusion . + Struct that contains information about a scene after it has been loaded. - + - is a Unity PhysX Collider. + Reference to the loaded scene. - + - is a Unity Box2D Collider. + Array of NetworkObjects present in the loaded scene. - + - Sorts all in ascending order of distance - from to the point. + The loaded Unity scene. - 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 . + Array of root GameObjects present in the loaded Unity scene. - List containing hits to be sorted. - If are null. - + - HitboxBuffer will store all snapshots of the colliders into a circular buffer + 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. - + - HitboxContainer represents 1 snapshot of all containers in a given Tick + Interface for handling the event when a scene load operation is started. - + - Query parameters for position rotation query + Method to be called when a scene load operation is started. + Reference to the scene that is being loaded. - + - Create a new . + Interface for callback. + Called when the joins AreaOfInterest. + Implement this interface on and classes. - Parameters to be used - The hitbox to be queried - + - Class that represents a box overlap query. Used to query against the API. + Called when the joins AreaOfInterest. + Object is now receiving snapshot updates. + Object will execute FixedUpdateNetwork() and Render() methods until the object leaves simulation. - + - The box query center. + Interface for the callback. + Called when the leaves AreaOfInterest. + Implement this interface on and classes. - + - The box query extents. + 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. - + - The box query rotation. + Interface for handling the event when an object is spawned. - + - Create a new with the given . + Method to be called when an object is spawned. - 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. + Interface for handling the event when the state authority changes. - 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. - + - Base parameters needed to execute a box overlap query + Method to be called when the state authority changes. - + - Create a new + Interface for handling the event when the input authority is gained. - Parameters to be used - The query center - The query extents - The query rotation - Capacity for the cached PhysX and Box2D static hits. - + - Base parameters needed to execute a query + Method to be called when the input authority is gained. - + - Class that represents a raycast all query. Used to query against the API. + Interface for handling the event when the input authority is lost. - + - Create a new with the given . + Method to be called when the input authority is lost. - 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. + 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. - 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. + Gets a value indicating whether the state buffer is valid. - + - Create a new with the given + Gets the state buffer associated with the network behaviour. - The parameters to be used when creating the query. - + - Base parameters needed to execute a raycast query + Gives access to the offset (in 32 bit words) and count (in 32 bit words) of this behaviour backing data - + - Create a new + The tick the data on this networked behaviour changed - 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. + The unique identifier for this network behaviour. - + - Create a new with the given . + Returns true if the of the associated is the designated as Input Source for this network entity. - The parameters to be used when creating the query. - + - Create a new with the given . + Returns true if the associated is the State Source for this network entity. - 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. - + - Base parameters needed to execute a sphere overlap query + 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. - + - Create a new . + 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. - 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 . + Returns true if the object is writable in the editor - i.e. when it is not attached + or has the state authority. - + - [Future Use] to represent a disabled . + Gets a bitmask of flags, representing the current local authority over this . - + - Geometry is a box, fill in Extents and (optional) Offset. + Resets the state of the object to the original state - + - Geometry is a sphere, fill in Radius and (optional) Offset. + Copies entire state of passed in source + Source to copy data from - + - Geometry is a capsule, fill in capsule Radius, capsule Height and (optional) Offset. + Fixed update callback for networked behaviours. - + - Represents a single lag-compensated collider. - Multiple component instances can be added anywhere in the hierarchy of a which includes a . + 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. - + - The collision geometry type for this . + Copies the state to the backing fields. This method is meant to be overridden in derived classes. - + - When is set to , this defines the local-space geometry for narrow-phase checks. + Post spawn callback. - + - When is set to , this defines the local-space geometry for narrow-phase checks. + Called before the network object is despawned + The runner that owns the object + If the state of the behaviour is still accessible - + - When is set to , this defines the local-space geometry for narrow-phase checks. + 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 - + - When is set to , this defines the local-space geometry for narrow-phase checks. + Provides a reader for network arrays of type T. + The type of elements in the network array. - + - This 's local-space offset from its GameObject position. + Contains data about the property to be read. - + - Reference to the top-level component for this . + 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. - + - The index of this hitbox in the array on . - The value is set by the root when initializing the nested hitboxes with . + Provides a reader for network linked lists of type T. + The type of elements in the network linked list. - + - Mask to access the state of this hitbox on the root. + Contains data about the property to be read. - + - 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. + 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. - + - Index assigned to the collider of this hitbox on the lag-compensated snapshots. + 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. - + - World-space position (includes Offset) of this . + Contains data about the property to be read. - + - Color used when drawing gizmos for this hitbox. + 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. - + - Draws this hitbox gizmo on Unity editor. + 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. + + - 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. + 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.
- + - Debug data from Broadphase BVH (tree depth). + 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. - + - Debug data from Broadphase BVH (total nodes count). + Provides a reader for properties of type T in a network behaviour. + The type of the property in the network behaviour. Must be unmanaged. - + - Debug data from lag compensation history (registered count). + Contains data about the property to be read. - + - Debug data used to draw the BVH nodes and the lag compensation history. + Constructs a new PropertyReader with the provided data. + The data about the property to be read. - + - 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. + Constructs a new PropertyReader with the provided offset. - 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 + The offset of the property in the network behaviour buffer. - + - 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. + Reads a property of type T from the provided network behaviour buffer. - 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 + The network behaviour buffer to read the property from. + The property of type T read from the buffer. - + - 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. + Reads a property of type T from the provided network behaviour buffers. - 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 + 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. - + - 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. + Gets a BehaviourReader for a network behaviour of type T. - 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. + 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 NetworkRunner associated with the NetworkBehaviour. + 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. + + + + + Indicates whether the NetworkBehaviour object has an override for the ReplicateTo method. + + + + + 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) 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. + + + + + + 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. + + + + + 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. @@ -2096,1994 +4579,6573 @@ 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. + + + + Internal use. Inserts (new ones) and updates all registered hitboxes into lag compensation history. + + + + + Register new hitboxes and updates existing ones on the client. + + + + Register new hitboxes and updates existing ones on the Server. + + + + Resets the registered flag. + + + + 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. + + + + + 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. + + + + 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. + + + + + 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. + + - 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. + Writes data from the UnityLinkedListSurrogate to a specified memory location. - 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 + The memory location to write to. + The number of elements to write. - + - 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. + Initializes the UnityLinkedListSurrogate with a specified capacity. - 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 + The capacity to initialize the UnityLinkedListSurrogate with. - + - 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. + Represents a base class for Unity surrogates. + This class is serializable and provides abstract methods for reading, writing, and initializing data. - 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. + Reads data from a specified memory location into the UnitySurrogateBase. - 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. + 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. - + - Performs a lag-compensated query for a specific Hitbox position and rotation. + The unique identifier for this network entity. - 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. + Signal that this comes from a Resume Spawn - 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 this entity is associated with. - 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. + Used for whenever objects need to be sorted in a deterministic order, like + when registering scene objects. - 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. + Delegate callback used to override if an object should be replicate to a client or not - 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. + Delegate callback used to override priority value for a specific object-player pair - 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. + How Object Interest is determined for this object. - 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. - + - Internal use. Inserts (new ones) and updates all registered hitboxes into lag compensation history. + Last tick this object received an update. - + - Used internally to write the benchmark results. + Flags used for network object prefabs and similar - + - Per-query options for lag compensation (both raycast and overlap). + 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. - + - Default, no extra options. + Array of initial child nested entities, that are children of this Object. - + - Add this to include checks against PhysX colliders. + Array of all s associated with this network entity. - + - Add this to include checks against Box2D colliders. If PhysX flag is set, it will be used instead. + The ID + Unity GameObject name for this entity. - + - Subtick accuracy query (exactly like seen by player). + Returns if this network entity is associated with its , and that runner is not null. - + - If the objects which the player performing the query - (if specified) has input authority over should be ignored by the query. + If this object is inserted into the simulation - + - Settings for lag compensation history. + Returns if is the designated Input Source for this network entity. - + - Hitbox snapshot history length in milliseconds. + Returns if is the designated State Source for this network entity. - + - Hitbox capacity per snapshot. + Returns if is neither the Input nor State Source for this network entity. - + - The size of the cached static colliders (PhysX or Box2D) array of the default Lag Compensation Queries. + Returns the for this instance, + indicating what snapshot data will be used to render it. - + - Broadphase BVH node expansion factor (default 20%) for leaf nodes, so updates are not too frequent. + Returns the for this instance, + indicating how snapshot data will be used to render it. - + - Optional: tries to optimize broadphase BVH every update. May be removed in the future. + Returns the current interpolation time for this object - + - Defines a lag compensated query hit result. + 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. - + - Hit object source (PhysX or Fusion Hitboxes). + 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. - + - 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. + Toggles if this NetworkObject is included in the , which will include the prefab in builds as a Spawnable object. - + - Surface normal (if requested) of the hit, at the lag compensated time. + Awake is called when the script instance is being loaded. - + - Point of impact of the hit, at the lag compensated time. + OnDestroy is called when the script instance is being destroyed. - + - Distance (if requested) to hit, at the lag compensated time. + 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. - + - Fusion's . Null in case the hit was on PhysX or Box2D. + Gets a bitmask of flags, representing the current local authority over this . - + - PhysX collider hit. Null in case hit is a Fusion or a Box2D hit. + Gets a bitmask of flags, representing the supplied RPC authority for this . - + - Box2D collider hit. Null in case hit is a Fusion or a PhysX hit. + Sets which has Input Authority for this Object. - + - Auxiliary field used when sorting hits in a collection. + Request state authority over this on shared mode. - + - Creates a structure from the information on a Unity . + Release the state authority over this on shared mode. - The used as source. - The built LagCompensatedHit structure. - + - Creates a structure from the information on a Unity . + Removes input authority from whichever player has it for this object. Only valid when called on a Host or Server peer. - The used as source. - The built LagCompensatedHit structure. - + - Creates a structure from the information on a . + Converts the Network Object to it's NetworkId. - The used as source. - The built LagCompensatedHit structure. + The object to convert + The of the object. Default if the object is not alive (null or destroyed) - + - 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. + 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 - + - Set of configuration options for a Hitbox Root behaviour. + Copies the entire State from another + to copy the State from - + - 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. + Copies the entire State from another based on the + to copy the state from - + - If Hitboxes on inactive Game Objects should be registered under this root upon initialization. + 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) - + - Set of configuration flags that replicate the behaviour as it was before the flag options were added. + 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 - + - Ser of configuration flags with the default behaviour, suitable for most use-cases. + Returns a string representation of the object. + The StringBuilder to append to. - + - 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. + 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. - + - The max number of hitboxes allowed under the same root. + Represents a state where no flags are set. - + - Set of configuration options for this Hitbox Root behaviour. - Check the API documentation for more details on what each flag represents. + Mask for isolating the version part of the flags. - + - 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. + Represents the first version of the network object flags. - + - 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. + Flag indicating that the network object should be ignored. - + - Color used when drawing gizmos for this hitbox. + Flag indicating that the network object is a master client object. - + - All Hitbox instances in hierarchy. Auto-filled at Spawned. + Flag indicating that the network object should be destroyed when the state authority leaves. - + - Reference to associated hitbox manager (from which lag compensated queries can be performed). + Flag indicating that the network object allows state authority override. - + + + Extension methods for the NetworkObjectFlags enum. + + + - If this is in interest for the current local player. + Returns the version of the flags. + The flags to get the version of. + The version of the flags. - + - Finds child components, and adds them to the collection. + Check if the flags are the current version. + The flags to check. + True if the flags are the current version, false otherwise. - + - Sets to a rough value which encompasses all in their current positions. + Sets the flags to the current version. + The flags to set. + The flags with the version set to the current version. - + - 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. + Check if the flags are ignored. - 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. + The flags to check. + True if the flags are ignored, false otherwise. - + - 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. + Sets the ignored flag on the flags. - 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. + Flags to set the ignored flag on. + Ignored flag value. + The flags with the ignored flag set to the given value. - + - A Networked fusion type for degrees. This can be used with the , in RPCs, or in structs. + 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. + - + - Clamps the current value to the supplied min-max range. + NetworkObjectGuid - + - Returns the smaller of two supplied angles. + EqualityComparer for NetworkObjectGuid - + - Returns the larger of two supplied angles. + Check if two NetworkObjectGuid are equals - + - Lerps between two angle values. + 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 + + - Returns a the value, clamped to the min-max range. + Create a new NetworkObjectGuid + The guid to use - + - Alternative base class to Unity's MonoBehaviour. - This allows for components that work both in Unity, as well as the Photon relays. + Create a new NetworkObjectGuid + Data0 of the Guid + Data1 of the Guid - + - Wrapper for Unity's GameObject.AddComponent() + Create a NetworkObjectGuid from a byte array + The byte array to create the NetworkObjectGuid from - + - Wrapper for Unity's GameObject.TryGetComponent() + Create a NetworkObjectGuid from a byte* + The byte* to create the NetworkObjectGuid from - + - Wrapper for Unity's GameObject.GetComponentInChildren() + Signal if the NetworkObjectGuid is valid. - + - Wrapper for Unity's GameObject.Destroy() + Implicit conversion from Guid to NetworkObjectGuid + Guid to convert from + NetworkObjectGuid - + - Defines the type of the current connection with the Remote Peer, - either the Server or a Client + Implicit conversion from NetworkObjectGuid to Guid + NetworkObjectGuid to convert from + Guid - + - No connection is currently active + Try to parse a string into a NetworkObjectGuid + String to parse + Parsed NetworkObjectGuid + True if the string was parsed successfully, false otherwise - + - Connection was accomplished using the Photon Relay Services + Parse a NetworkObjectGuid from a string. + The string to parse. + The parsed NetworkObjectGuid. - + - Connection was accomplished directly with the remote peer + Compare two NetworkObjectGuid + True if the NetworkObjectGuid are equal, false otherwise - + - The fixed size of the array. + Compare two NetworkObjectGuid + True if the NetworkObjectGuid are not equal, false otherwise - + - Indexer of array elements. + Check if the NetworkObjectGuid is equal to another NetworkObjectGuid + The other NetworkObjectGuid to check against + True if the NetworkObjectGuids are equal, false otherwise - + - NetworkArray constructor. + Check if the NetworkObjectGuid is equal to another object + The other object to check against + True if the objects are equal, false otherwise - + - Allocates a new array and copies values from this array. For a non-alloc alternative use . + Get the hashcode for a NetworkObjectGuid - + - Adds each value to the supplied List. This does not clear the list, so values will be appended to the existing list. + Returns a string representation of the NetworkObjectGuid. - + - Copies values to the supplied array. + Returns a string representation of the NetworkObjectGuid. - - 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. - + - Copies a range of values in from a supplied source array. + Returns a string representation of the NetworkObjectGuid. - Starting index of elements in source. - Number of sequential source elements to copy in. - + - Copies a range of values in from a supplied source list. + Compare the NetworkObjectGuid to another NetworkObjectGuid - Starting index of elements in source. - Number of sequential source elements to copy in. + 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 - + - 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. + Explicit conversion from NetworkObjectGuid to NetworkPrefabRef + NetworkObjectGuid to convert from + NetworkPrefabRef - + - This may only be deterministic on 64 bit systems. + NetworkPrefabRef - - - - - - - A set of parameters that tune the interpolated correction of prediction error on transform data. + A decoupled prefab reference. Internally stored as a GUID. - + - - 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. - + EqualityComparer for NetworkPrefabRef - + - - 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. - + Check if two NetworkPrefabRef are equals - + - - 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. - + 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 + + - - 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. - + Create a new NetworkPrefabRef + The guid to use - + - - 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. - + Create a new NetworkPrefabRef + Data0 of the Guid + Data1 of the Guid - + - - 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. - + Create a NetworkPrefabRef from a byte array + The byte array to create the NetworkPrefabRef from - + - - 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. - + Create a NetworkPrefabRef from a byte* + The byte* to create the NetworkPrefabRef from - + - - 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. - + Signal if the NetworkPrefabRef is valid. - + - - 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. - + Implicit conversion from Guid to NetworkPrefabRef + Guid to convert from + NetworkPrefabRef - + - 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; - + Implicit conversion from NetworkPrefabRef to Guid +
+ NetworkPrefabRef to convert from + Guid +
+ + + Try to parse a string into a NetworkPrefabRef - T can be a primitive, or an INetworkStruct. + String to parse + Parsed NetworkPrefabRef + True if the string was parsed successfully, false otherwise - + - The fixed size of the array. + Parse a NetworkPrefabRef from a string. + The string to parse. + The parsed NetworkPrefabRef. - + - Indexer of array elements. + Compare two NetworkPrefabRef + True if the NetworkPrefabRef are equal, false otherwise - + - NetworkArray constructor. + Compare two NetworkPrefabRef + True if the NetworkPrefabRef are not equal, false otherwise - + - Returns the array value at supplied index. + Check if the NetworkPrefabRef is equal to another NetworkPrefabRef + The other NetworkPrefabRef to check against + True if the NetworkPrefabRefs are equal, false otherwise - + - Sets the array value at the supplied index. + Check if the NetworkPrefabRef is equal to another object + The other object to check against + True if the objects are equal, false otherwise - + - 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. + Get the hashcode for a NetworkPrefabRef - - - - + - Allocates a new array and copies values from this array. For a non-alloc alternative use . + Returns a string representation of the NetworkPrefabRef. - + - Adds each value to the supplied List. This does not clear the list, so values will be appended to the existing list. + Returns a string representation of the NetworkPrefabRef. - + - Copies values to the supplied array. + Returns a string representation of the NetworkPrefabRef. - - 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. - + - Copies a range of values in from a supplied source array. + Compare the NetworkPrefabRef to another NetworkPrefabRef - Starting index of elements in source. - Number of sequential source elements to copy in. + 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 - + - Copies a range of values in from a supplied source list. + Explicit conversion from NetworkPrefabRef to NetworkObjectGuid - Starting index of elements in source. - Number of sequential source elements to copy in. + NetworkPrefabRef to convert from + NetworkObjectGuid - + - 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. + Enum representing various flags for a network object header. + Each flag represents a different state or property of a network object. - + - The fixed size of the array. + Flag indicating that the object is of global interest. - + - Indexer of array elements. + Flag indicating that the object should be destroyed when the state authority leaves. - + - NetworkArrayReadOnly constructor. + Flag indicating that the object was spawned by a client. - + - 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); - + Flag indicating that the state authority override is allowed.
- Key can be a primitive, or an INetworkStruct. - Value can be a primitive, or an INetworkStruct.
- + - Current number of key/value entries in the Dictionary. + Flag indicating that the object is a struct. - + - The maximum number of entries this dictionary may contain. + Flag indicating that the object is an array of structs. - + - Key indexer. Gets/Sets value for specified key. + Flag indicating that the object should not be destroyed on load. - + - Remove all entries from the Dictionary, and clear backing memory. + Flag indicating that the object has a main network TRSP. - + - Returns true if the Dictionary contains an entry for the given key. + Flag indicating that the object is in an area of interest. - + - Returns true if the Dictionary contains an entry value which compares as equal to given value. + Represents a pointer to a NetworkObjectHeader. + This struct is unsafe because it uses pointers. - 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. + Pointer to a NetworkObjectHeader. - + - Sets the value for the given key. Will add a new key if the key does not already exist. + Gets the Type of the NetworkObjectHeader this struct points to. - + - Adds a new key value pair to the Dictionary. If the key already exists, will return false. + Gets the Id of the NetworkObjectHeader this struct points to. - + - Attempts to get the value for a given key. If found, returns true. + Network object header information for a . - 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 size of the NetworkObjectHeader in bytes. - - Returns true if key was found. - + - Removes entry from Dictionary. If successful (key existed), returns true and the value of removed item. + The size of the NetworkObjectHeader in words. - The key to remove. - Returns value of removed item. Returns default value if key did not exist. - Returns true if key was found. - + - Current number of key/value entries in the Dictionary. + The word index of the player data in the NetworkObjectHeader. - + - The maximum number of entries this dictionary may contain. + The unique identifier of the network object. - + - Returns the value for the given key. Will throw an error if the key is not found. + The number of words in the network object header. - + - Attempts to get the value for a given key. If found, returns true. + The number of behaviours in the network object. - The key to remove. - Returns value of removed item. Returns default value if key did not exist. - Returns true if key was found. - + - Flag interface for custom NetworkInput structs. + The type identifier of the network object. - + - Translates structs and represents them in Fusions's unsafe allocated memory. + The unique identifier of the root network object in the nesting hierarchy. - + - Tries to export data as the indicated T struct. + The nesting key of the network object. - + - Tries to import data from a struct. + The flags indicating various states or properties of the network object. - + - 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); - + The player reference who has input authority over the network object.
- T can be a primitive, or an INetworkStruct.
- + - Returns the current element count. + The player reference who has state authority over the network object. - + - Returns the max element count. + The unique data for each player. - + - Element indexer. + Reserved space for future use. - + - Removes and clears all list elements. + how many bytes this headers object is - + - Returns true if the value already exists in the list. + Returns a pointer to the data of a NetworkObjectHeader. + Pointer to the NetworkObjectHeader. + Pointer to the data of the NetworkObjectHeader. - + - Returns true if the value already exists in the list. + Returns the count of data words in a NetworkObjectHeader. + Pointer to the NetworkObjectHeader. + The count of data words in the NetworkObjectHeader. - + - Sets the value at supplied index. + 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. - + - Returns the value at supplied index. + 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 the index with this value. Returns -1 if not found. + 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. - + - Returns the index with this value. Returns -1 if not found. + The string representation of the NetworkObjectHeader. - Specify custom IEqualityComparer to be used for compare. - + - Removes the first found element with indicated value. + Checks if the current instance of NetworkObjectHeader is equal to another instance of the same type. - + - Removes the first found element with indicated value. + Checks if the current instance of NetworkObjectHeader is equal to another object. - + - Adds a value to the end of the list. + Generates a hash code for the current instance of NetworkObjectHeader. - - + - Returns the current element count. + Determines if two instances of NetworkObjectHeader are equal. + True if the instances are equal; otherwise, false. - + - Returns the max element count. + Determines if two instances of NetworkObjectHeader are not equal. + True if the instances are not equal; otherwise, false. - + - Element indexer. + Compute the CRC of this Object Snapshot - + - Returns true if the value already exists in the list. + Interface for initializing network objects. - + - Returns true if the value already exists in the list. + Initializes the network object. + The network object to initialize. - + - Returns the value at supplied index. + Initializes network objects for Unity. - + - Returns the index with this value. Returns -1 if not found. + Initializes the network object. + The network object to initialize. - + - Returns the index with this value. Returns -1 if not found. + Meta information about a network object. - Specify custom IEqualityComparer to be used for compare. - + + 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. + + - PCG32 random generator, 16 bytes in size. - http://www.pcg-random.org + A key used to identify a network object nesting. - + - 0x1.00000001p-32 aka 0x3df0000000100000 + Implements the IEqualityComparer interface. - + - 0x1p-32 aka 0x3df0000000000000 + Determines whether two NetworkObjectNestingKey objects are equal. - + - 0x1.000002p-24 aka 0x33800001 + 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. + + - 0x1p-24 aka 0x33800000 + Checks if the NetworkObjectNestingKey is none. + True if the value of the NetworkObjectNestingKey is 0; otherwise, false. - + - Returns a random Double within [0, 1] (range is inclusive). + Checks if the NetworkObjectNestingKey is valid. - + True if the value of the NetworkObjectNestingKey is greater than 0; otherwise, false. - + - Returns a random Double within [0, 1) (range is exclusive). + Initializes a new instance of the NetworkObjectNestingKey struct with a specified value. - + The value of the NetworkObjectNestingKey. - + - Returns a random Single within [0, 1] (range is inclusive). + 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. - + - [0, 1) - Returns a random Single within [0, 1) (range is exclusive). + 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. - + - [int.MinValue, int.MaxValue] + Serves as the default hash function. - + A hash code for the current object. - + - [0, uint.MaxValue] + Returns a string that represents the current object. - + A string that represents the current object. - + - Returns a random Double within [minInclusive, maxInclusive] (range is inclusive). - If minInclusive is greater than maxInclusive, then the numbers are automatically swapped. + 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(). - + - Returns a random Single within [minInclusive, maxInclusive] (range is inclusive). - If minInclusive is greater than maxInclusive, then the numbers are automatically swapped. + 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. - + - 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. + 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. - + - Returns a random Int32 within [minInclusive, maxInclusive] (range is inclusive). - If minInclusive is greater than maxInclusive, then the numbers are automatically swapped. + Represents the context for acquiring a prefab instance for a network object. + This struct is unsafe because it uses pointers. - + - 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. + The identifier of the prefab. - + - Returns a random UInt32 within [minInclusive, maxInclusive] (range is inclusive). - If minInclusive is greater than maxInclusive, then the numbers are automatically swapped. + The metadata of the network object. - + - Fixed-size UTF32 string. All operations are alloc-free, except for converting to . + Indicates whether the operation is synchronous. - - + - Maximum UTF32 string length. + Indicates whether the network object should not be destroyed on load. - + - Converts to/from regular UTF16 string. Setter is alloc-free. Use - to get possibly alloc-free conversion. + 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. - + - 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. + Checks if the Header is not null. + True if the Header is not null; otherwise, false. - + - Returns UTF32 scalar at position. To iterate over characters, - use . + 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. - + - Checks if is equivalent and if not converts to UTF16 and - stores the result in . + 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. - - - False if no conversion was performed, true otherwise. - + - Converts to UTF32 string and stores it internally. + Initializes a new instance of the NetworkObjectReleaseContext struct with the specified parameters. - - False if was too long to fit and had to be trimmed. + 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. - + - Calculates the length of the equivalent UTF16 string. + Returns a string that represents the current object. - + A string that represents the current object. - + - Represents a Fusion player. + Enum representing the possible results of acquiring a prefab instance for a network object. - 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 - - + + 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. + + - None player + A dummy implementation of the INetworkObjectProvider interface. + This class is used for testing purposes and throws a NotImplementedException for all its methods. - + + + + + + + - Special master client player ref value of -1 + This class is used to compare two NetworkObject instances based on their SortKey. + It implements the IComparer interface. - + - If this player ref is a valid unique player index + An instance of the NetworkObjectSortKeyComparer class. - + - Returns true if the index value equals -1 (internal raw value of 0), indicating no player. + 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. + - + - 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. + The NetworkObjectStats class provides statistics related to a network object. + It includes bandwidth, updates, and player count within the area of interest. - + - Returns the index backing value without modification. - Unlike which returns the backing value - 1. - 0=None -1=MasterClient >0=PlayerId + Represents the inbound bandwidth of the network object. - + - Returns the PlayerRef int as an integer Id value. - -1=None -2=MasterClient >=0=PlayerId + Represents the outbound bandwidth of the network object. - + - Returns the PlayerRef as an integer Id value. - -1=None -2=MasterClient + Represents the inbound updates of the network object. - + - - 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. - + Represents the outbound updates of the network object. - + - Returns a new instance. + Represents the count of players within the area of interest of the network object. - + - Returns a new instance. + Resets all the statistics of the network object to their default values. - + - The number of items in the buffer. + Enum representing the type of a NetworkObject. - + - The maximum number of items that can be in the buffer. + Represents a NetworkObject that is a Prefab. - + - True if the buffer contains no items. + Represents a NetworkObject that is a Custom type. - + - True if the buffer contains the maximum number of items. + Represents a NetworkObject that is an InternalStruct. - + - 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. + Represents a NetworkObject that is a SceneObject. - - + - The front item in the buffer. + Represents an Invalid NetworkObject type. - + - The back item in the buffer. + ID for a Prefab which has been cataloged in a . - + - Inserts an item at the back of the buffer. + Comparer - + - Inserts an item at the front of the buffer. + Checks if two NetworkObjectTypeId instances are equal. - + - Removes and returns the item at the back of the buffer. + 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. + + - Removes and returns the item at the front of the buffer. + 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. - + - Removes all items from the buffer. + 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. - + - Returns an ArraySegment pair, where both segments and the items within them follow insertion order. - Does not copy. + 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. - + - Returns a new array with the buffer's items in insertion order. + 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. - + - Returns an enumerator that can iterate the buffer. + 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. + - + - Converts index into the corresponding index in _buffer. + 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. - + - Increments the provided index variable, wrapping around if necessary. + 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. + - + - Decrements the provided index variable, wrapping around if necessary. + 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. + + - None scene + Checks if the NetworkObjectTypeId is invalid. - + - If this scene index is valid + Checks if the NetworkObjectTypeId is valid. - + - Returns lower 32 bits as an index. + Checks if the NetworkObjectTypeId is a SceneObject. - + - 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 . + Checks if the NetworkObjectTypeId is a Prefab. - - - + - Returns true if the values are equal. + Checks if the NetworkObjectTypeId is an InternalStruct. - - - - + - Returns true if the values are not equal. + Checks if the NetworkObjectTypeId is a Custom type. - - - - + - The number of available samples. + Checks if the current NetworkObjectTypeId instance is equal to another NetworkObjectTypeId instance. + The other NetworkObjectTypeId instance to compare with the current instance. - + - The maximum number samples that can fit in this series. + Generates a hash code for the current NetworkObjectTypeId instance. - + - True if the series contains zero samples. + Determines whether the specified object is equal to the current NetworkObjectTypeId instance. + The object to compare with the current NetworkObjectTypeId instance. - + - True if the series contains the maximum number of samples. + Returns a string that represents the current NetworkObjectTypeId instance. - + + Determines whether two NetworkObjectTypeId instances are equal. + + + Determines whether two NetworkObjectTypeId instances are not equal. + + - The most recent sample. + Converts a NetworkPrefabId instance to a NetworkObjectTypeId instance. + The NetworkPrefabId instance to convert. + + A NetworkObjectTypeId instance that represents a Prefab with the given NetworkPrefabId. + - + - The arithmetic mean of the samples in the series. + Interface for a network asset source. + Type of the network asset. - + - The variance of the samples in the series. + Acquires the network asset. + If true, the acquisition is done synchronously. - + - The standard deviation of the samples in the series. + Releases the network asset. - + - The smallest value in the series. + Waits for the result of the network asset acquisition. + The network asset. - + - The largest value in the series. + Checks if the network asset acquisition is completed. - + - Add a new sample. If the series is full, the oldest sample will be removed. + Gets the description of the network asset. - - + - Removes all samples and resets statistical values. + Interface for a network prefab source. - + - The unique identifier for a network entity. + 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 . - + - String conversion specifically for use in prefixing names of GameObjects. + Equality comparer for NetworkPrefabId. - - + - The primary Fusion component for networked GameObject entities. - This stores the object's network identity and manages the object's state and input authority. + Checks if two NetworkPrefabId are equal. - + - The unique identifier for this network entity. + Gets the hash code of a NetworkPrefabId. - + - Signal that this comes from a Resume Spawn + The size of a NetworkPrefabId. - + - The this entity is associated with. + The alignment of a NetworkPrefabId. - + - Used for whenever objects need to be sorted in a deterministic order, like - when registering scene objects. + The maximum index value of a NetworkPrefabId. - + - Delegate callback used to override if an object should be replicate to a client or not + The raw value of the NetworkPrefabId. - + - Delegate callback used to override priority value for a specific object-player pair + Checks if the NetworkPrefabId is none. - + - How Object Interest is determined for this object. + Checks if the NetworkPrefabId is valid. - + - Last tick this object received an update. + Converts the NetworkPrefabId to an index. - + - Flags used for network object prefabs and similar + Creates a NetworkPrefabId from an index. - + - 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. + Creates a NetworkPrefabId from a raw value. - + - Array of initial child nested entities, that are children of this Object. + Checks if the NetworkPrefabId is equal to another NetworkPrefabId. - + - Array of all s associated with this network entity. + Checks if the NetworkPrefabId is equal to another object. - + - The ID + Unity GameObject name for this entity. + Gets the hash code of the NetworkPrefabId. - + - Returns if this network entity is associated with its , and that runner is not null. + Converts the NetworkPrefabId to a string. - + - If this object is inserted into the simulation + Compares the NetworkPrefabId to another object. - + - Returns if is the designated Input Source for this network entity. + Converts the NetworkPrefabId to a string with optional brackets and prefix. - + - Returns if is the designated State Source for this network entity. + Checks if two NetworkPrefabId are equal. - + - Returns if is neither the Input nor State Source for this network entity. + Checks if two NetworkPrefabId are not equal. - + - Returns the for this instance, - indicating what snapshot data will be used to render it. + Compares the NetworkPrefabId to another NetworkPrefabId. - + - Returns the for this instance, - indicating how snapshot data will be used to render it. + Meta data for a prefab which has been cataloged in a . - + - Returns the current interpolation time for this object + Prefab ID. + Use + to look up the actual prefab reference in the . - + - 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. + Header data for the prefab. - + - 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. + 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 . - + - Toggles if this NetworkObject is included in the , which will include the prefab in builds as a Spawnable object. + If the Header is not null. - + - Get the word count for a + Data pointer to the first word of this 's data block. - The object to get the word count from - - - + - Gets a bitmask of flags, representing the current local authority over this . + Enum representing the possible results of attempting to get a prefab from the NetworkPrefabTable. - + - Gets a bitmask of flags, representing the supplied RPC authority for this . + The prefab was successfully retrieved. - + - Sets which has Input Authority for this Object. + The retrieval of the prefab is in progress. - + - Request state authority over this on shared mode. + The prefab was not found in the NetworkPrefabTable. - + - Release the state authority over this on shared mode. + There was an error in loading the prefab. - + - Removes input authority from whichever player has it for this object. Only valid when called on a Host or Server peer. + Class representing a table of network prefabs. - + - Add or remove specific player interest in this NetworkObject. Only the NetworkObject State Authority can set interest. - - must be set to . - + Options for the NetworkPrefabTable. - - - + - Copies the entire State from another + All prefab sources. - to copy the State from - + - Copies the entire State from another based on the + Acquired prefabs mask. - to copy the state from - + - Return the . + Data about acquired prefabs. Only indices matched by are valid. - 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 reference on that matches the provided + Translates guid to index in . - 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 true if this network entity existed as part of a scene, rather than having been dynamically spawned. + Incremented every time a change occurs. - + - Returns true if this network entity is a spawned prefab's root, rather than being a scene object or a nested prefab object. + All prefab sources. - + - Returns true if this network entity is a spawned prefab's nested object, rather than being a scene object or a root prefab object. + Prefab table version. Incremented every time a change occurs. - + - A decoupled prefab reference. Internally stored as a GUID. + Returns all entries in the table. - + - Network object header information for a . + Adds a prefab source to the table. + Prefab source to add. + Thrown if a prefab source with the same guid already exists. - + - how many bytes this headers object is + 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. - + - Compute the CRC of this Object Snapshot + Gets a prefab source by guid. - + Guid of the prefab source. + The prefab source, or default if not found. - + - 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(). + Gets a prefab source by id. + Id of the prefab source. + The prefab source, or default if not found. - + - If the Header is not null. + Gets a prefab id by guid. + Guid of the prefab source. + The prefab id, or default if not found. - + - Data pointer to the first word of this 's data block. + 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. - + - ID for a Prefab which has been cataloged in a . + Load a prefab by id. + Id of the prefab. + If true, the load will be synchronous. + The loaded prefab, or null if not found. - + - Comparer + Unload a prefab by id. + Id of the prefab. + True if the prefab was unloaded, false otherwise. - + - ID for a Prefab which has been cataloged in a . + Unload all unreferenced prefabs. + If true, incomplete loads will be unloaded as well. + The number of prefabs unloaded. - + - Meta data for a prefab which has been cataloged in a . + Unload all prefabs. - + - Prefab ID. - Use - to look up the actual prefab reference in the . + Clear the prefab table. - + - Header data for the prefab. + Options for the NetworkPrefabTable. - + - 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 true, prefabs will be unloaded when the last instance is released. - + - If the Header is not null. + If true, all prefabs will be unloaded on shutdown. - + - Data pointer to the first word of this 's data block. + Default options. - + - All prefab sources. + Provides constants and methods for managing authority masks. - + - Acquired prefabs mask. + Constant representing the state authority mask. - + - Data about acquired prefabs. Only indices matched by are valid. + Constant representing the input authority mask. - + - Translates guid to index in . + Constant representing the proxy authority mask. - + - Incremented every time a change occurs. + Constant representing no authority. - + - + Constant representing all authorities. - + - Flag constants for input and state authority. + 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. @@ -4164,6 +11226,11 @@ The legal types that can trigger this Rpc. Default is The types that will receive and invoke this method. Default is + + + Flags for the RPC channel. + + Rpc order preserved, delivery verified, resend in case of a failed delivery. @@ -4174,6 +11241,76 @@ 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. @@ -4189,6 +11326,90 @@ 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. @@ -4206,6 +11427,20 @@ + + 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. @@ -4223,7 +11458,7 @@ - Not invoked locally because is false and simulation stage is + Not invoked locally because InvokeResim is false and simulation stage is @@ -4292,6 +11527,48 @@ 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. @@ -4303,6 +11580,54 @@ + + 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. @@ -4386,7 +11711,7 @@ Setup Host Migration information - + Host Migration info @@ -4517,12 +11842,12 @@ - Returns the fixed tick time interval. Derived from the . + Returns the fixed tick time interval. Derived from the . - The time the current State represents (the most recent FixedUpdateNetwork simulation). + 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). @@ -4692,9 +12017,13 @@ - Disconnect a player from the server + Disconnects a player from the server. - Player to disconnect + 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. + @@ -4747,7 +12076,7 @@ Get the number of interfaces of the desired type that are registered on the behaviour updater. The interface type - + The number of interfaces @@ -4763,14 +12092,14 @@ 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 @@ -4796,21 +12125,21 @@ 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 @@ -4839,28 +12168,21 @@ 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. @@ -4880,10 +12202,10 @@ - Returns array of all registered with this . + 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. @@ -4896,19 +12218,25 @@ 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 . @@ -4922,16 +12250,22 @@ - Send an arbitrary data buffer to a target Player + Sends a reliable data buffer to a target player. - Player that should receive the buffer - Buffer to be sent + The player who should receive the buffer. + The key associated with the reliable data. + The data buffer to be sent. - Send an arbitrary data buffer to the Server + Sends a reliable data buffer to the server. - Buffer to be sent + 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. + @@ -4960,7 +12294,7 @@ Get the instance for this from a . - + NetworkID to look forward null if object cannot be found. @@ -4983,8 +12317,8 @@ Get the instance for this from a . - - + NetworkBehaviourId to look forward + NetworkBehaviour reference, if found True if object was found. @@ -5000,22 +12334,22 @@ 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. @@ -5030,23 +12364,24 @@ 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 - Clears the passed results collection, and adds all current AOI cell data. Each element in the List represents one AOI cell. + 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. @@ -5068,19 +12403,25 @@ - Returns if the contains a reference to a in the current State . + Returns if the contains a reference to a in the current State. - Returns if the contains a with given in the current State . + Returns if the contains a with given in the current State. - Destroys a . + 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. @@ -5117,10 +12458,14 @@ - Attaches a user created network object to the network + Attaches a user-created network object to the network. - The object to attach - If assigned who is the default input authority for this object + 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. @@ -5148,12 +12493,14 @@ - Registers + 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. @@ -5168,13 +12515,27 @@ 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. @@ -5206,11 +12567,6 @@ depend on the result of this task. - - - Is this runner responsible for scene management. - - Is this runner responsible for scene management. @@ -5222,11 +12578,6 @@ with any scene loading operation. - - - Returns the current loaded network scene. - - Tries to get the of this . @@ -5237,8 +12588,60 @@ - - + + + + + + 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 @@ -5256,6 +12659,11 @@ Invoke on all implementations + + + The main scene of the or default if not running. + + Get the a GameObject instance belongs to. @@ -5300,6 +12708,13 @@ 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 @@ -5311,8 +12726,19 @@ 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 + @@ -5328,7 +12754,7 @@ Must be a Type derived from used to spawn the - T reference, or null if it was not able to spawn the object"), + T reference, or null if it was not able to spawn the object Spawn Position Spawn Rotation Player Input Authority @@ -5351,7 +12777,7 @@ 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 of its derived classes such as to replicate the initial transform state. + Use (or any custom class derived from NetworkTRSP) to replicate the initial transform state. Prefab used to spawn the Spawn Position @@ -5365,7 +12791,7 @@ 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 of its derived classes such as to replicate the initial transform state. + Use (or any custom class derived from NetworkTRSP) to replicate the initial transform state. Prefab Ref used to spawn the Spawn Position @@ -5379,7 +12805,7 @@ 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 of its derived classes such as to replicate the initial transform state. + Use (or any custom class derived from NetworkTRSP) to replicate the initial transform state. Object Guid used to spawn the Spawn Position @@ -5393,7 +12819,7 @@ 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 of its derived classes such as to replicate the initial transform state. + Use (or any custom class derived from NetworkTRSP) to replicate the initial transform state. Prefab ID used to spawn the Spawn Position @@ -5409,7 +12835,8 @@ Must be a Type derived from used to spawn the - T reference, or null if it was not able to spawn the object"), + T reference, or null if it was not able to spawn the object + Spawned reference Spawn Position Spawn Rotation Player Input Authority @@ -5426,13 +12853,14 @@ 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 of its derived classes such as to replicate the initial transform state. + Use (or any custom class derived from NetworkTRSP) to replicate the initial transform state. Prefab used to spawn the Spawn Position @@ -5440,13 +12868,14 @@ 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 of its derived classes such as to replicate the initial transform state. + Use (or any custom class derived from NetworkTRSP) to replicate the initial transform state. Prefab Ref used to spawn the Spawn Position @@ -5454,13 +12883,14 @@ 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 of its derived classes such as to replicate the initial transform state. + Use (or any custom class derived from NetworkTRSP) to replicate the initial transform state. Object Guid used to spawn the Spawn Position @@ -5468,13 +12898,14 @@ 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 of its derived classes such as to replicate the initial transform state. + Use (or any custom class derived from NetworkTRSP) to replicate the initial transform state. Prefab ID used to spawn the Spawn Position @@ -5482,6 +12913,7 @@ Player Input Authority reference Spawn flags + Spawned reference reference, or null if it was not able to spawn the object @@ -5490,7 +12922,8 @@ Must be a Type derived from used to spawn the - T reference, or null if it was not able to spawn the object"), + 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 @@ -5513,7 +12946,7 @@ 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 of its derived classes such as to replicate the initial transform state. + Use (or any custom class derived from NetworkTRSP) to replicate the initial transform state. Prefab used to spawn the Spawn Position @@ -5527,7 +12960,7 @@ 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 of its derived classes such as to replicate the initial transform state. + Use (or any custom class derived from NetworkTRSP) to replicate the initial transform state. Prefab Ref used to spawn the Spawn Position @@ -5541,7 +12974,7 @@ 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 of its derived classes such as to replicate the initial transform state. + Use (or any custom class derived from NetworkTRSP) to replicate the initial transform state. Object Guid used to spawn the Spawn Position @@ -5555,7 +12988,7 @@ 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 of its derived classes such as to replicate the initial transform state. + Use (or any custom class derived from NetworkTRSP) to replicate the initial transform state. Prefab ID used to spawn the Spawn Position @@ -5666,7 +13099,6 @@ 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. @@ -5676,7 +13108,7 @@ 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. @@ -5723,6 +13155,80 @@ 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, @@ -5730,6 +13236,143 @@ + + + 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. @@ -5776,6 +13419,11 @@ 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 @@ -5820,7 +13468,7 @@ - This flag changes the behaviour of to return null (instead of throwing an exception) and ) to return + 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. @@ -5906,6 +13554,13 @@ 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 . @@ -5940,36 +13595,36 @@ Remove unnecessary data from serialized version of . - + - Default file name for the asset + Manages and references the current instance of - + - + The current instance. - + - + The current instance. - + - Invoked when a config is a about to be loaded from a default location (a Resource ). - If the event returns a non-null value, it will accepted as the config source and no attempt - to load the default asset will be made. + Try to get the current instance. + instance if it exists, otherwise null. + True if the instance exists, otherwise false. - + - Invoked when a config is about to be unloaded (due to ). + True if the instance exists, otherwise false. - + - Manages and references the current instance of + Unload the current instance. @@ -5977,14 +13632,58 @@ 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 . + 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. @@ -6000,6 +13699,86 @@ 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 @@ -6151,6 +13930,22 @@ 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. @@ -6172,10 +13967,11 @@ - + Callback from when an input is missing. - - + NetworkRunner reference + PlayerRef reference which the input is missing from + NetworkInput reference which is missing @@ -6235,18 +14031,143 @@ 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. + + - Invokes for all the runners - and stores them for upcoming . + Checks if the settings are equal. - + Settings to check for equality. + Settings to check for equality. + True if equal, false otherwise. - + - Invokes for all the runners - that have been updaed with the last . + Checks if the settings are not equal. + Settings to check for equality. + Settings to check for equality. + True if not equal, false otherwise. @@ -6430,14 +14351,14 @@ - - 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. - + + 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) - + Default: false (uses ports 27000, 27001 and 27002) + @@ -6446,209 +14367,549 @@ 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 + + - Specify a Custom STUN Server used to Resolve the peer Reflexive Addresses - - Default: null (no custom STUN Server) + Compares two for equality + The other + Returns true if the two are equal - + - Custom Authentication Data - - Default: null (default authentication values) + Compares two for equality + The other object to check + Returns true if the two are equal - + - Custom Photon Application Settings - - Default: null (Global PhotonAppSettings) + Returns the hash code of the - + - Enables the Session creation when starting a Client with an specific Session Name - - Default: false (clients *can not* create new Sessions) + Parameters for loading a scene - + - Host Migration Token used when restarting the Fusion Simulation - - Default: null + The unique id of the scene load operation - + - Callback invoked when the new Host is migrating from the old Host state - - Default: null + The to use when loading the scene - + - Optional CancellationToken used to cancel the NetworkRunner start up process and shutdown - - Defaults: null + The to use when loading the scene - - - Enables the usage of the previous cached regions pings. This speeds up the region ping process and the runner startup process. - - Defaults: false - + + + The to use when loading the scene + - + - StartGameArgs ToString() + Signals if the scene should be active on load - + - Describe an Exception that Occurred while starting the Fusion Simulation + Signals if the scene should be single loaded - + - ShutdownReason that caused this exception + Signals if the scene should have local 2D physics - + - StartGameException to String + Signals if the scene should have local 3D physics - + - Represents the result of starting the Fusion Simulation + Compares two for equality + The other + Returns true if the two are equal - + - Signal if the Start was OK + Compares two for equality + The other + Returns true if the two are equal - + - Start Game Shutdown Reason + Returns the hash code of the - + - Custom Error Message filled with data about the Shutdown. - Usually used to store custom data when the StartGame fails. + Compares two for equality + Left + Right + Returns true if the two are equal - + - Optional Exception StackTrace + Compares two for inequality + Left + Right + Returns true if the two are not equal - + - StartGameResult to String + Returns a string representation of the - - + - Convert arbitrary Exceptions into a StartGameException to public use + Network Scene Info Default Flags - Exception to be converted - Reference to a StartGameException holding a ShutdownReason - + + The scene count mask + + + The counter mask + + - Callback for initialization + 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 + + - Callback for shutdown and clean up + 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 - + + + + - Signals if the instance is busy with any scene loading operations + Total Scene Count - + - The main scene of the . Mostly used for Multipeer logic + Version number - + - Signals if the given scene is the main runner scene. Mostly used for Multipeer logic + 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 - + - Tries to get the physics scene 2D. + Removes a scene from the list - Returns true if the operation was successfully + Scene to remove + Returns true if the scene was removed - + - Tries to get the physics scene 3D. + String representation of the - Returns true if the operation was successfully - + - Mark an object as `DontDestroyOnLoad`. + Compares two for equality + The other + Returns true if the two are equal - + - Move a to a desired scene. + Compares two for equality - Return true if the operation was successfully + The other + Returns true if the two are equal - + - Loads a given scene with the specified parameters. + Get the hash code of the - Returns a that can be waited + Hast code of the - + - Unloads a given scene. + Implicit conversion to - Returns a that can be waited + SceneRef to convert + Returns a instance - + - Gets a for the scene that the given belongs to. + What has contributed to the observed change in the scene info. - + - Gets a for the given scene name or path. + No change. - + - 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. + The initial local scene has changed. - Return true if a custom handling is provided, false otherwise to use the default one - + - The default implementation of . 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 remove scene has changed. - + - What has contributed to the observed change in the scene info. + A unique identifier for a scene object. @@ -6667,6 +14928,35 @@ 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. @@ -6718,8 +15008,17 @@ - Can be used to acquire for different points in time. + 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. @@ -6733,15 +15032,92 @@ - Clears the passed results collection, and adds all current AOI cell data. Each element in the List represents one AOI cell. + 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 @@ -6752,6 +15128,11 @@ latest tick on server we are aware of + + + Simulation Stats + + How large the ticks the current simulation takes are @@ -6784,7 +15165,7 @@ - Gets the fixed tick time interval. Derived from the . + Gets the fixed tick time interval. Derived from the . @@ -6851,6 +15232,16 @@ 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. @@ -6876,6 +15267,21 @@ 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. @@ -6916,14 +15322,149 @@ 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. - - must be set to . - + + + 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 @@ -6945,12 +15486,29 @@ 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 @@ -6958,6 +15516,12 @@ 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 @@ -6989,6 +15553,11 @@ Result flags for the RPC message send operation. + + + Invalid result. + + Client sent to the server, server will send to the target client. @@ -7029,6 +15598,18 @@ 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. + @@ -7095,19 +15676,19 @@ - - - - - - - - + Input Data Word Count - - Features to enabled to replication such as area of interest, etc. - + 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 @@ -7124,6 +15705,11 @@ 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 @@ -7251,7 +15837,7 @@ Initializes and creates a copy of this . - + A copy of this . @@ -7290,249 +15876,572 @@ - The oscillates between 0 and 1. Values below this threshold are reduced to zero, resulting in a value equal to . + 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 + + + + + The maximum amount (%) of inputs allowed to arrive late because of jitter. + Determines the minimum target simulation offset. + + + + + Increases the target simulation offset by a fixed duration. + This is effectively how many extra chances inputs have to reach the server in time. + + + + + The maximum amount (%) a client's simulation can speed up or slow down + to maintain its target simulation offset. + + + + + + Controls the range where the client's simulation speed scales linearly with the + simulation offset error (until it maxes out at )." + + + + + + + A client's simulation will only speed up or slow down if its simulation offset + is off-target by more than this amount (%). + + + + + + + A client will reset its simulation state if its simulation offset + is off-target by more than this amount (%). + + + + + + The maximum amount (%) of snapshots allowed to arrive late because of jitter. + Determines the minimum target interpolation delay. + + + + + Increases the target interpolation delay by a fixed duration. + This is effectively how many extra chances clients have to receive new snapshots in time. + + + + + + The maximum amount (%) that remote object interpolation on the client can speed up or slow down + to maintain its target interpolation delay. + + + + + + + Controls the range where the client's interpolation speed scales linearly with the + interpolation delay error (until it maxes out at )." + + + + + + + Remote object interpolation on the client will only speed up or slow down if its delay + is off-target by more than this amount (%). + + + + + + + A client will reset its interpolation state if its interpolation delay + is off-target by more than this percentage. + + + + + Simulation Connection Statistics + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - 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. + Simulation Input - + - The lowest loss chance value the oscillator will produce. 0 = 0% chance of being lost. 1 = 100% chance of being lost. + Buffer for s. - + + Number of inputs in the buffer. + + + Whether the buffer is full. + + - The highest loss chance value the oscillator will produce. 0 = 0% chance of being lost. 1 = 100% chance of being lost. + Creates a new . + Network project configuration. - + + Clears the buffer. + + - The wave oscillates between 0 and 1. Values below this threshold are reduced to zero, resulting in a value equal to . + Copies the buffer to an array and sorts it. + Array to copy to. + Number of elements copied. - + - The period of the oscillator (the rate at which delay oscillates between and ). + Whether the buffer contains an input for . + Tick to check. + Whether the buffer contains an input for . - + - After the oscillation loss chance is calculated, an additional random value of 0 to this (normalized) percentage of loss chance is added. + Removes an input for from the buffer. + Tick to remove. + Removed input. + Whether an input was removed. - + - The maximum amount (%) of inputs allowed to arrive late because of jitter. - Determines the minimum target simulation offset. + Gets the insert time for . + Tick to get insert time for. + Insert time for . - + - Increases the target simulation offset by a fixed duration. - This is effectively how many extra chances inputs have to reach the server in time. + Gets the input for . + Tick to get input for. + Input for . - + - The maximum amount (%) a client's simulation can speed up or slow down - to maintain its target simulation offset. + Adds an input to the buffer. + Input to add. + Insert time for . + Whether the input was added. - + - - Controls the range where the client's simulation speed scales linearly with the - simulation offset error (until it maxes out at )." - + Player that owns this input. - + - - A client's simulation will only speed up or slow down if its simulation offset - is off-target by more than this amount (%). - + Header for this input. - + - - A client will reset its simulation state if its simulation offset - is off-target by more than this amount (%). - + Data for this input. - + - The maximum amount (%) of snapshots allowed to arrive late because of jitter. - Determines the minimum target interpolation delay. + Simulation input sent count. - + - Increases the target interpolation delay by a fixed duration. - This is effectively how many extra chances clients have to receive new snapshots in time. + Clear a total of words from this input. + Word count to clear. - + - - The maximum amount (%) that remote object interpolation on the client can speed up or slow down - to maintain its target interpolation delay. - + Copy words from to this input. + Input to copy from. + Word count to copy. - + - - Controls the range where the client's interpolation speed scales linearly with the - interpolation delay error (until it maxes out at )." - + 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. + + - - Remote object interpolation on the client will only speed up or slow down if its delay - is off-target by more than this amount (%). - + Simulation Message - + + SimulationMessage 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. + + - - A client will reset its interpolation state if its interpolation delay - is off-target by more than this percentage. - + 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 - + - Capacity in Bits of this + Read a int from a + SimulationMessage to read from + int read - + - Current offset in Bits + Get the byte pointer content of a + SimulationMessage to get the byte pointer of + Byte pointer of the @@ -7540,7 +16449,23 @@ Simulation to get the Memory from Size in bytes of the new - + Pointer to the new + + + Simulation Message ToString + + + Simulation Message ToString + + + + Simulation Message Pointer + + + + + Pointer to the message. + @@ -7613,135 +16538,217 @@ 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 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 + + - + 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 + + + diff --git a/Assets/Photon/Fusion/Assemblies/Fusion.Sockets.dll b/Assets/Photon/Fusion/Assemblies/Fusion.Sockets.dll index aa484629b1..82fe9f0e08 100644 Binary files a/Assets/Photon/Fusion/Assemblies/Fusion.Sockets.dll and b/Assets/Photon/Fusion/Assemblies/Fusion.Sockets.dll differ diff --git a/Assets/Photon/Fusion/Assemblies/Fusion.Sockets.dll.debug b/Assets/Photon/Fusion/Assemblies/Fusion.Sockets.dll.debug index 61a05ef1fc..f988b854fd 100644 Binary files a/Assets/Photon/Fusion/Assemblies/Fusion.Sockets.dll.debug and b/Assets/Photon/Fusion/Assemblies/Fusion.Sockets.dll.debug differ diff --git a/Assets/Photon/Fusion/Assemblies/Fusion.Sockets.pdb.debug b/Assets/Photon/Fusion/Assemblies/Fusion.Sockets.pdb.debug index 99155192dc..48dc367729 100644 Binary files a/Assets/Photon/Fusion/Assemblies/Fusion.Sockets.pdb.debug and b/Assets/Photon/Fusion/Assemblies/Fusion.Sockets.pdb.debug differ diff --git a/Assets/Photon/Fusion/Assemblies/Fusion.Sockets.xml b/Assets/Photon/Fusion/Assemblies/Fusion.Sockets.xml index e708bd8782..fabd015441 100644 --- a/Assets/Photon/Fusion/Assemblies/Fusion.Sockets.xml +++ b/Assets/Photon/Fusion/Assemblies/Fusion.Sockets.xml @@ -75,7 +75,16 @@ Port used to build the NetAddress New NetAddress reference - + + + Create a new NetAddress based on the IP and Port passed as argument + + String representation of an IP, either IPv4 or IPv6 + Port used to build the NetAddress + New NetAddress reference + If IP is empty/null or an invalid IP, or port < 0 + If unable to parse IP + IPv4 Subnet Mask Utilities @@ -360,13 +369,17 @@ - if from is LARGER than to, result is positive - if from is LESSER than to, result is negative - if they are the same, result is zero + Calculates the distance between two sequence numbers, taking into account the circular nature of the sequence. - - - + The sequence number to start from. + The sequence number to calculate the distance to. + + The distance between the two sequence numbers. + If 'from' is larger than 'to', the result is positive. + If 'from' is lesser than 'to', the result is negative. + If they are the same, the result is zero. + + Thrown when the calculated distance is outside the range of an integer. @@ -423,15 +436,15 @@ This class implements STUN Client. Defined in RFC 8489 - Session Traversal Utilities for NAT (STUN) - Traversal Using Relays around NAT (TURN): Relay Extensions to Session Traversal Utilities for NAT(STUN) - Happy Eyeballs Version 2: Better Connectivity Using Concurrency - State of Peer-to-Peer (P2P) Communication across Network Address Translators(NATs) - - - - - + Session Traversal Utilities for NAT (STUN) + Traversal Using Relays around NAT (TURN): Relay Extensions to Session Traversal Utilities for NAT(STUN) + Happy Eyeballs Version 2: Better Connectivity Using Concurrency + State of Peer-to-Peer (P2P) Communication across Network Address Translators(NATs) + + + + + @@ -441,17 +454,25 @@ - Run a STUN Binding Request against the Public STUN Server in order to discover peer reflexive addresses + Sends a STUN Binding Request to a public STUN server to discover peer reflexive addresses. - Network Peer reference - Network Socket reference - Running Task of the STUN Query Procedure + A reference to the network peer. + A reference to the network socket. + The original address family. + The ID of the request. This is a reference parameter that may be changed within the method if necessary. + + Returns true if the STUN Binding Request was successfully sent, false otherwise. + + Thrown when an error occurs while sending the STUN Binding Request. - Retrieve the Local IP Endpoint currently active + Retrieves the local IP endpoint currently active. - + The address family to be used. + The local IP address that is currently active. This is an output parameter. + Returns true if the local IP address was successfully retrieved, false otherwise. + Thrown when an error occurs while creating the socket or connecting to the test IP. @@ -545,6 +566,7 @@ Parses STUN message from raw data packet. Raw STUN message. + Length of raw STUN message. @@ -608,10 +630,10 @@ - Default constructor. + Initializes a new instance of the class. - Specifies UDP network type. - Public IP end point. + The public IP endpoint. Defaults to an unspecified IPv4 address. + The private IP endpoint. Defaults to an unspecified IPv4 address. @@ -620,11 +642,13 @@ - - + Builds a STUN server object from a given STUN server address. - - + The STUN server address in the format "ip:port". + A Task that represents the asynchronous operation. The Task's result is the STUN server object. + Thrown when the provided STUN server address is not in the correct format. + Thrown when an error is encountered when resolving the hostname to an IP address. + @@ -687,6 +711,17 @@ How the conversion happens depends on the the Type of Communicator + + + Change master client request Message + Used to signal that Fusion Simulation should start + + + + + Player Unique Ref + + Base Protocol Message. @@ -718,7 +753,6 @@ Creates a copy of this Message - @@ -737,7 +771,7 @@ Used by the specialized versions of Message to serialize its data - Buffer to read from or write into the data of the Message + Buffer to read from or write into the data of the Message @@ -768,7 +802,9 @@ Disconnect Protocol Message - Disconnect Reason + The reason for the disconnection. + The version of the protocol to be used. Defaults to the latest protocol version. + The version of the serialization to be used. Defaults to null. @@ -1061,7 +1097,6 @@ Create a clone with this Snapshot and reset reference - @@ -1142,14 +1177,14 @@ Zero (0) means: if it should be the room itself (authorative event). - + Default CustomData Key of Realtime Events - + diff --git a/Assets/Photon/Fusion/Assemblies/Fusion.Sockets.xml.meta b/Assets/Photon/Fusion/Assemblies/Fusion.Sockets.xml.meta index ce36a366fc..ba6db3e604 100644 --- a/Assets/Photon/Fusion/Assemblies/Fusion.Sockets.xml.meta +++ b/Assets/Photon/Fusion/Assemblies/Fusion.Sockets.xml.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 1255ea8da94f5af47b99b4382c35946d +guid: e3c156d97ba299a479d13b30aea0dc34 labels: - FusionCodeDoc TextScriptImporter: diff --git a/Assets/Photon/Fusion/Demos/BasicNetworkSetup.unity b/Assets/Photon/Fusion/Demos/BasicNetworkSetup.unity deleted file mode 100644 index c8579cf848..0000000000 --- a/Assets/Photon/Fusion/Demos/BasicNetworkSetup.unity +++ /dev/null @@ -1,518 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!29 &1 -OcclusionCullingSettings: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_OcclusionBakeSettings: - smallestOccluder: 5 - smallestHole: 0.25 - backfaceThreshold: 100 - m_SceneGUID: 00000000000000000000000000000000 - m_OcclusionCullingData: {fileID: 0} ---- !u!104 &2 -RenderSettings: - m_ObjectHideFlags: 0 - serializedVersion: 9 - m_Fog: 0 - m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} - m_FogMode: 3 - m_FogDensity: 0.01 - m_LinearFogStart: 0 - m_LinearFogEnd: 300 - m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} - m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} - m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} - m_AmbientIntensity: 1 - m_AmbientMode: 0 - m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} - m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} - m_HaloStrength: 0.5 - m_FlareStrength: 1 - m_FlareFadeSpeed: 3 - m_HaloTexture: {fileID: 0} - m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} - m_DefaultReflectionMode: 0 - m_DefaultReflectionResolution: 128 - m_ReflectionBounces: 1 - m_ReflectionIntensity: 1 - m_CustomReflection: {fileID: 0} - m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.18028378, g: 0.22571412, b: 0.30692285, a: 1} - m_UseRadianceAmbientProbe: 0 ---- !u!157 &3 -LightmapSettings: - m_ObjectHideFlags: 0 - serializedVersion: 12 - m_GIWorkflowMode: 1 - m_GISettings: - serializedVersion: 2 - m_BounceScale: 1 - m_IndirectOutputScale: 1 - m_AlbedoBoost: 1 - m_EnvironmentLightingMode: 0 - m_EnableBakedLightmaps: 1 - m_EnableRealtimeLightmaps: 0 - m_LightmapEditorSettings: - serializedVersion: 12 - m_Resolution: 2 - m_BakeResolution: 40 - m_AtlasSize: 1024 - m_AO: 0 - m_AOMaxDistance: 1 - m_CompAOExponent: 1 - m_CompAOExponentDirect: 0 - m_ExtractAmbientOcclusion: 0 - m_Padding: 2 - m_LightmapParameters: {fileID: 0} - m_LightmapsBakeMode: 1 - m_TextureCompression: 1 - m_FinalGather: 0 - m_FinalGatherFiltering: 1 - m_FinalGatherRayCount: 256 - m_ReflectionCompression: 2 - m_MixedBakeMode: 2 - m_BakeBackend: 1 - m_PVRSampling: 1 - m_PVRDirectSampleCount: 32 - m_PVRSampleCount: 512 - m_PVRBounces: 2 - m_PVREnvironmentSampleCount: 256 - m_PVREnvironmentReferencePointCount: 2048 - m_PVRFilteringMode: 1 - m_PVRDenoiserTypeDirect: 1 - m_PVRDenoiserTypeIndirect: 1 - m_PVRDenoiserTypeAO: 1 - m_PVRFilterTypeDirect: 0 - m_PVRFilterTypeIndirect: 0 - m_PVRFilterTypeAO: 0 - m_PVREnvironmentMIS: 1 - m_PVRCulling: 1 - m_PVRFilteringGaussRadiusDirect: 1 - m_PVRFilteringGaussRadiusIndirect: 5 - m_PVRFilteringGaussRadiusAO: 2 - m_PVRFilteringAtrousPositionSigmaDirect: 0.5 - m_PVRFilteringAtrousPositionSigmaIndirect: 2 - m_PVRFilteringAtrousPositionSigmaAO: 1 - m_ExportTrainingData: 0 - m_TrainingDataDestination: TrainingData - m_LightProbeSampleCountMultiplier: 4 - m_LightingDataAsset: {fileID: 0} - m_LightingSettings: {fileID: 0} ---- !u!196 &4 -NavMeshSettings: - serializedVersion: 2 - m_ObjectHideFlags: 0 - m_BuildSettings: - serializedVersion: 2 - agentTypeID: 0 - agentRadius: 0.5 - agentHeight: 2 - agentSlope: 45 - agentClimb: 0.4 - ledgeDropHeight: 0 - maxJumpAcrossDistance: 0 - minRegionArea: 2 - manualCellSize: 0 - cellSize: 0.16666667 - manualTileSize: 0 - tileSize: 256 - accuratePlacement: 0 - maxJobWorkers: 0 - preserveTilesOutsideBounds: 0 - debug: - m_Flags: 0 - m_NavMeshData: {fileID: 0} ---- !u!1 &897760119 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 897760121} - - component: {fileID: 897760120} - - component: {fileID: 897760122} - m_Layer: 0 - m_Name: Directional Light - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!108 &897760120 -Light: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 897760119} - m_Enabled: 1 - serializedVersion: 10 - m_Type: 1 - m_Shape: 0 - m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} - m_Intensity: 1 - m_Range: 10 - m_SpotAngle: 30 - m_InnerSpotAngle: 21.80208 - m_CookieSize: 10 - m_Shadows: - m_Type: 2 - m_Resolution: -1 - m_CustomResolution: -1 - m_Strength: 1 - m_Bias: 0.05 - m_NormalBias: 0.4 - m_NearPlane: 0.2 - m_CullingMatrixOverride: - e00: 1 - e01: 0 - e02: 0 - e03: 0 - e10: 0 - e11: 1 - e12: 0 - e13: 0 - e20: 0 - e21: 0 - e22: 1 - e23: 0 - e30: 0 - e31: 0 - e32: 0 - e33: 1 - m_UseCullingMatrixOverride: 0 - m_Cookie: {fileID: 0} - m_DrawHalo: 0 - m_Flare: {fileID: 0} - m_RenderMode: 0 - m_CullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_RenderingLayerMask: 1 - m_Lightmapping: 4 - m_LightShadowCasterMode: 0 - m_AreaSize: {x: 1, y: 1} - m_BounceIntensity: 1 - m_ColorTemperature: 6570 - m_UseColorTemperature: 0 - m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} - m_UseBoundingSphereOverride: 0 - m_UseViewFrustumForShadowCasterCull: 1 - m_ShadowRadius: 0 - m_ShadowAngle: 0 ---- !u!4 &897760121 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 897760119} - m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} - m_LocalPosition: {x: 0, y: 3, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} ---- !u!114 &897760122 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 897760119} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: d73b0a95be81246699cf0d9ecdc01863, type: 3} - m_Name: - m_EditorClassIdentifier: - PreferredRunner: 0 - Components: - - {fileID: 897760120} - _guid: 6df6401d-8c12-4c45- ---- !u!1 &1009396345 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1009396348} - - component: {fileID: 1009396347} - - component: {fileID: 1009396346} - m_Layer: 0 - m_Name: Prototype Network Start - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &1009396346 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1009396345} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 8ba5764f4714bd64ab9efab127938e77, type: 3} - m_Name: - m_EditorClassIdentifier: - EnableHotkeys: 0 - BaseSkin: {fileID: 11400000, guid: e59b35dfeb4b6f54e9b2791b2a40a510, type: 2} ---- !u!114 &1009396347 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1009396345} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 88230848386761045af440d808ee3efa, type: 3} - m_Name: - m_EditorClassIdentifier: - RunnerPrefab: {fileID: 1485416254} - StartMode: 0 - AutoStartAs: 2 - AutoHideGUI: 1 - AutoClients: 1 - ClientStartDelay: 0.1 - ServerPort: 0 - DefaultRoomName: - AlwaysShowStats: 0 - InitialScenePath: - _currentStage: 0 ---- !u!4 &1009396348 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1009396345} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 2 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &1260219170 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1260219173} - - component: {fileID: 1260219172} - - component: {fileID: 1260219171} - - component: {fileID: 1260219174} - m_Layer: 0 - m_Name: Main Camera - m_TagString: MainCamera - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!81 &1260219171 -AudioListener: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1260219170} - m_Enabled: 1 ---- !u!20 &1260219172 -Camera: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1260219170} - m_Enabled: 1 - serializedVersion: 2 - m_ClearFlags: 1 - m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} - m_projectionMatrixMode: 1 - m_GateFitMode: 2 - m_FOVAxisMode: 0 - m_SensorSize: {x: 36, y: 24} - m_LensShift: {x: 0, y: 0} - m_FocalLength: 50 - m_NormalizedViewPortRect: - serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 - near clip plane: 0.3 - far clip plane: 1000 - field of view: 60 - orthographic: 0 - orthographic size: 5 - m_Depth: -1 - m_CullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_RenderingPath: -1 - m_TargetTexture: {fileID: 0} - m_TargetDisplay: 0 - m_TargetEye: 3 - m_HDR: 1 - m_AllowMSAA: 1 - m_AllowDynamicResolution: 0 - m_ForceIntoRT: 0 - m_OcclusionCulling: 1 - m_StereoConvergence: 10 - m_StereoSeparation: 0.022 ---- !u!4 &1260219173 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1260219170} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 1, z: -10} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &1260219174 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1260219170} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: d73b0a95be81246699cf0d9ecdc01863, type: 3} - m_Name: - m_EditorClassIdentifier: - PreferredRunner: 0 - Components: - - {fileID: 1260219171} - _guid: fe07d91a-a109-4c0e- ---- !u!1 &1485416252 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1485416255} - - component: {fileID: 1485416254} - - component: {fileID: 1485416253} - m_Layer: 0 - m_Name: Prototype Runner - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &1485416253 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1485416252} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -232609262, guid: e725a070cec140c4caffb81624c8c787, type: 3} - m_Name: - m_EditorClassIdentifier: - OnInput: - m_PersistentCalls: - m_Calls: [] - OnInputMissing: - m_PersistentCalls: - m_Calls: [] - OnConnectedToServer: - m_PersistentCalls: - m_Calls: [] - OnDisconnectedFromServer: - m_PersistentCalls: - m_Calls: [] - OnConnectRequest: - m_PersistentCalls: - m_Calls: [] - OnConnectFailed: - m_PersistentCalls: - m_Calls: [] - PlayerJoined: - m_PersistentCalls: - m_Calls: [] - PlayerLeft: - m_PersistentCalls: - m_Calls: [] - OnSimulationMessage: - m_PersistentCalls: - m_Calls: [] - OnShutdown: - m_PersistentCalls: - m_Calls: [] - OnSessionListUpdate: - m_PersistentCalls: - m_Calls: [] - OnCustomAuthenticationResponse: - m_PersistentCalls: - m_Calls: [] - OnHostMigration: - m_PersistentCalls: - m_Calls: [] - OnSceneLoadDone: - m_PersistentCalls: - m_Calls: [] - OnSceneLoadStart: - m_PersistentCalls: - m_Calls: [] - OnReliableData: - m_PersistentCalls: - m_Calls: [] - OnObjectEnterAOI: - m_PersistentCalls: - m_Calls: [] - OnObjectExitAOI: - m_PersistentCalls: - m_Calls: [] ---- !u!114 &1485416254 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1485416252} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -1199893898, guid: e725a070cec140c4caffb81624c8c787, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!4 &1485416255 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1485416252} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 3, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 3 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Assets/Photon/Fusion/Editor/Fusion.Unity.Editor.cs b/Assets/Photon/Fusion/Editor/Fusion.Unity.Editor.cs index abf3a64a38..1a280dec1e 100644 --- a/Assets/Photon/Fusion/Editor/Fusion.Unity.Editor.cs +++ b/Assets/Photon/Fusion/Editor/Fusion.Unity.Editor.cs @@ -1966,11 +1966,13 @@ public void OnPreprocessBuild(BuildReport report) { #region AssetDatabaseUtils.Addressables.cs -#if FUSION_ENABLE_ADDRESSABLES && !FUSION_DISABLE_ADDRESSABLES +#if (FUSION_ADDRESSABLES || FUSION_ENABLE_ADDRESSABLES) && !FUSION_DISABLE_ADDRESSABLES namespace Fusion.Editor { using System; using System.Collections.Generic; using System.Linq; + using UnityEditor; + using UnityEditor.AddressableAssets; using UnityEditor.AddressableAssets.Settings; using UnityEngine; @@ -2010,6 +2012,70 @@ public static void AddAddressableAssetsWithLabelMonitor(string label, Action(LazyLoadReference reference) where T : UnityEngine.Object { if (!AssetDatabase.TryGetGUIDAndLocalFileIdentifier(reference, out var guid, out long localId)) { throw new ArgumentException($"Asset with instanceId {reference} not found"); @@ -2079,6 +2163,14 @@ public static (string, long) GetGUIDAndLocalFileIdentifierOrThrow(LazyLoadRef return (guid, localId); } + public static (string, long) GetGUIDAndLocalFileIdentifierOrThrow(UnityEngine.Object obj) { + if (!AssetDatabase.TryGetGUIDAndLocalFileIdentifier(obj, out var guid, out long localId)) { + throw new ArgumentException(nameof(obj)); + } + + return (guid, localId); + } + public static (string, long) GetGUIDAndLocalFileIdentifierOrThrow(int instanceId) { if (!AssetDatabase.TryGetGUIDAndLocalFileIdentifier(instanceId, out var guid, out long localId)) { throw new ArgumentException($"Asset with instanceId {instanceId} not found"); @@ -2086,6 +2178,13 @@ public static (string, long) GetGUIDAndLocalFileIdentifierOrThrow(int instanceId return (guid, localId); } + + public static void MoveAssetOrThrow(string source, string destination) { + var error = AssetDatabase.MoveAsset(source, destination); + if (!string.IsNullOrEmpty(error)) { + throw new ArgumentException($"Failed to move {source} to {destination}: {error}"); + } + } public static bool HasLabel(string assetPath, string label) { var guidStr = AssetDatabase.AssetPathToGUID(assetPath); @@ -2189,6 +2288,44 @@ public static bool HasScriptingDefineSymbol(BuildTargetGroup group, string value return System.Array.IndexOf(defines, value) >= 0; } + public static T SetScriptableObjectType(ScriptableObject obj) where T : ScriptableObject { + return (T)SetScriptableObjectType(obj, typeof(T)); + } + + public static ScriptableObject SetScriptableObjectType(ScriptableObject obj, Type type) { + const string ScriptPropertyName = "m_Script"; + + if (!obj) { + throw new ArgumentNullException(nameof(obj)); + } + if (type == null) { + throw new ArgumentNullException(nameof(type)); + } + if (!type.IsSubclassOf(typeof(ScriptableObject))) { + throw new ArgumentException($"Type {type} is not a subclass of {nameof(ScriptableObject)}"); + } + + if (obj.GetType() == type) { + return obj; + } + + var tmp = ScriptableObject.CreateInstance(type); + try { + using (var dst = new SerializedObject(obj)) { + using (var src = new SerializedObject(tmp)) { + var scriptDst = dst.FindPropertyOrThrow(ScriptPropertyName); + var scriptSrc = src.FindPropertyOrThrow(ScriptPropertyName); + Debug.Assert(scriptDst.objectReferenceValue != scriptSrc.objectReferenceValue); + dst.CopyFromSerializedProperty(scriptSrc); + dst.ApplyModifiedPropertiesWithoutUndo(); + return (ScriptableObject)dst.targetObject; + } + } + } finally { + UnityEngine.Object.DestroyImmediate(tmp); + } + } + private static bool IsEnumValueObsolete(string valueName) where T : System.Enum { var fi = typeof(T).GetField(valueName); var attributes = fi.GetCustomAttributes(typeof(System.ObsoleteAttribute), false); @@ -2439,9 +2576,7 @@ public void Draw(Editor editor) { bool checkResult; if (getter == null) { - // use the property - var rootProperty = editor.serializedObject.GetIterator(); - checkResult = DoIfAttributeDrawer.CheckDraw(doIf, rootProperty); + checkResult = DoIfAttributeDrawer.CheckDraw(doIf, editor.serializedObject); } else { var value = getter(targets[0]); checkResult = DoIfAttributeDrawer.CheckCondition(doIf, value); @@ -4322,14 +4457,20 @@ public static System.Type GetDrawerTypeIncludingWorkarounds(System.Attribute att return drawerType; } - public static void DisplayTypePickerMenu(Rect position, Type baseType, Action callback, string noneOptionLabel = "[None]", bool groupByNamespace = true, Type selectedType = null, bool enableAbstract = false, bool enableGenericTypeDefinitions = false) { - var types = TypeCache.GetTypesDerivedFrom(baseType) - .Where(x => - (enableAbstract || !x.IsAbstract) && - (enableGenericTypeDefinitions || !x.IsGenericTypeDefinition) - ) - .OrderBy(x => x.FullName) - .ToList(); + public static void DisplayTypePickerMenu(Rect position, Type[] baseTypes, Action callback, Func filter, string noneOptionLabel = "[None]", bool groupByNamespace = true, Type selectedType = null) { + + var types = new List(); + + foreach (var baseType in baseTypes) { + types.AddRange(TypeCache.GetTypesDerivedFrom(baseType).Where(filter)); + } + + if (baseTypes.Length > 1) { + types = types.Distinct().ToList(); + } + + types.Sort((a, b) => string.CompareOrdinal(a.FullName, b.FullName)); + List menuOptions = new List(); var actualTypes = new Dictionary(); @@ -4376,6 +4517,37 @@ public static void DisplayTypePickerMenu(Rect position, Type baseType, Action callback, string noneOptionLabel = "[None]", bool groupByNamespace = true, Type selectedType = null, bool enableAbstract = false, bool enableGenericTypeDefinitions = false) { + DisplayTypePickerMenu(position, baseTypes, callback, x => + (enableAbstract || !x.IsAbstract) && + (enableGenericTypeDefinitions || !x.IsGenericTypeDefinition)); + } + + public static void DisplayTypePickerMenu(Rect position, Type baseType, Action callback, string noneOptionLabel = "[None]", bool groupByNamespace = true, Type selectedType = null, bool enableAbstract = false, bool enableGenericTypeDefinitions = false) { + DisplayTypePickerMenu(position, new [] { baseType }, callback, x => + (enableAbstract || !x.IsAbstract) && + (enableGenericTypeDefinitions || !x.IsGenericTypeDefinition)); + } + } +} + +#endregion + + +#region FusionEditorUtility.cs + +namespace Fusion.Editor { + using System; + using UnityEditor; + + partial class FusionEditorUtility { + public static void DelayCall(EditorApplication.CallbackFunction callback) { + FusionEditorLog.Assert(callback.Target == null, "DelayCall callback needs to stateless"); + EditorApplication.delayCall -= callback; + EditorApplication.delayCall += callback; + } } } @@ -4754,7 +4926,7 @@ protected virtual GenericMenu CreateContextMenu(TItem item, TreeView treeView) { return null; } - protected static Column MakeSimpleColumn(Expression> propertyExpression, Column column) where T : IComparable { + protected static Column MakeSimpleColumn(Expression> propertyExpression, Column column) { string propertyName; if (propertyExpression.Body is MemberExpression memberExpression) { @@ -4769,7 +4941,9 @@ protected static Column MakeSimpleColumn(Expression> propertyE column.getSearchText ??= toString; column.getComparer ??= order => (a, b) => EditorUtility.NaturalCompare(toString(a), toString(b)) * order; column.cellGUI ??= (item, rect, selected, focused) => TreeView.DefaultGUI.Label(rect, toString(item), selected, focused); - column.headerContent = new GUIContent(propertyName); + if (string.IsNullOrEmpty(column.headerContent.text) && string.IsNullOrEmpty(column.headerContent.tooltip)) { + column.headerContent = new GUIContent(propertyName); + } return column; } @@ -5048,6 +5222,7 @@ public unsafe void Refresh(Span data, int maxLength = 2048, bool addSpaces _builder.AppendLine("..."); } + _lastHash = arrayHash; _lastValue = new GUIContent(_builder.ToString()); } else { Debug.Assert(_lastValue != null); @@ -5106,6 +5281,7 @@ public void Refresh(SerializedProperty property, int maxLength = 2048) { _builder.AppendLine("..."); } + _lastHash = arrayHash; _lastValue = new GUIContent(_builder.ToString()); } else { Debug.Assert(_lastValue != null); @@ -5142,6 +5318,25 @@ namespace Fusion.Editor { static partial class ReflectionUtils { public const BindingFlags DefaultBindingFlags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance; + public static string GetShortAssemblyQualifiedName(this Type type) { + + var result = type.AssemblyQualifiedName; + if (result == null) { + throw new InvalidOperationException(); + } + + string RemoveSuffixStartingWith(string str, string part) { + var i = str.IndexOf(part, StringComparison.Ordinal); + return i >= 0 ? str.Substring(0, i) : str; + } + + result = RemoveSuffixStartingWith(result, ", Version="); + result = RemoveSuffixStartingWith(result, ", Culture="); + result = RemoveSuffixStartingWith(result, ", PublicKeyToken="); + + return result; + } + public static Type GetUnityLeafType(this Type type) { if (type.HasElementType) { type = type.GetElementType(); @@ -5806,7 +6001,7 @@ public static SerializedProperty FindPropertyOrThrow(this SerializedObject so, s public static SerializedProperty FindPropertyRelativeOrThrow(this SerializedProperty sp, string relativePropertyPath) { var result = sp.FindPropertyRelative(relativePropertyPath); if (result == null) { - throw new ArgumentOutOfRangeException(nameof(relativePropertyPath), $"Property not found: {relativePropertyPath} (relative to {sp.propertyPath} of {sp.serializedObject.targetObject}"); + throw new ArgumentOutOfRangeException(nameof(relativePropertyPath), $"Property not found: {relativePropertyPath} (relative to \"{sp.propertyPath}\" of {sp.serializedObject.targetObject}"); } return result; @@ -6789,7 +6984,6 @@ namespace Fusion.Editor { internal partial class BinaryDataAttributeDrawer : PropertyDrawerWithErrorHandling, INonApplicableOnArrayElements { - private int MaxLength = 2048; private int MaxLines = 16; private RawDataDrawer _drawer = new RawDataDrawer(); @@ -7309,13 +7503,15 @@ private static bool CheckProperty(DoIfAttributeBase doIf, SerializedProperty com // maybe this is a top-level property then and we can use reflection? if (depth != 0) { if (doIf.ErrorOnConditionMemberNotFound) { - FusionEditorLog.ErrorInspector($"Can't check condition for {referencePath}: non-SerializedProperty checks only work for top-level properties"); + FusionEditorLog.ErrorInspector($"Can't check condition for {referencePath}: non-SerializedProperty checks only work for top-level properties (depth:{depth}, conditionMember:{doIf.ConditionMember})"); } } else { try { getter = objType.CreateGetter(doIf.ConditionMember, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static | BindingFlags.FlattenHierarchy); } catch (Exception e) { - FusionEditorLog.ErrorInspector($"Can't check condition for {referencePath}: unable to create getter for {doIf.ConditionMember} with exception {e}"); + if (doIf.ErrorOnConditionMemberNotFound) { + FusionEditorLog.ErrorInspector($"Can't check condition for {referencePath}: unable to create getter for {doIf.ConditionMember} with exception {e}"); + } } } @@ -8035,6 +8231,7 @@ public override void OnGUI(Rect p, SerializedProperty prop, GUIContent label) { int value; + using (new FusionEditorGUI.PropertyScope(p, label, prop)) using (new FusionEditorGUI.ShowMixedValueScope(prop.hasMultipleDifferentValues)) { value = EditorGUI.LayerField(p, label, prop.intValue); } @@ -8884,13 +9081,7 @@ protected override void OnGUIInternal(Rect position, SerializedProperty property FusionEditorGUI.DisplayTypePickerMenu(position, baseType, t => { string typeName = string.Empty; if (t != null) { - typeName = t.AssemblyQualifiedName; - if (attr?.UseFullAssemblyQualifiedName == false) { - var versionIndex = typeName.IndexOf(", Version=", StringComparison.Ordinal); - if (versionIndex > 0) { - typeName = typeName.Substring(0, versionIndex); - } - } + typeName = attr?.UseFullAssemblyQualifiedName == false ? t.GetShortAssemblyQualifiedName() : t.AssemblyQualifiedName; } valueProperty.stringValue = typeName; @@ -8923,6 +9114,7 @@ protected override void OnGUIInternal(Rect position, SerializedProperty property Rect pickerRect; if (label == GUIContent.none) { pickerRect = position; + pickerRect.height = EditorGUIUtility.singleLineHeight; } else { pickerRect = EditorGUI.PrefixLabel(new Rect(position) { height = EditorGUIUtility.singleLineHeight }, FusionEditorGUI.WhitespaceContent); } @@ -8931,7 +9123,13 @@ protected override void OnGUIInternal(Rect position, SerializedProperty property var instanceType = instance?.GetType(); if (EditorGUI.DropdownButton(pickerRect, new GUIContent(instanceType?.FullName ?? NullContent), FocusType.Keyboard)) { - FusionEditorGUI.DisplayTypePickerMenu(pickerRect, fieldInfo.FieldType.GetUnityLeafType(), t => { + + var types = attribute.Types; + if (!types.Any()) { + types = new[] { fieldInfo.FieldType.GetUnityLeafType() }; + } + + FusionEditorGUI.DisplayTypePickerMenu(pickerRect, types, t => { if (t == null) { instance = null; } else if (t.IsInstanceOfType(instance)) { @@ -9151,7 +9349,7 @@ protected override void OnGUIInternal(Rect position, SerializedProperty property assetPath = AssetDatabase.GUIDToAssetPath(guid); } - using (new EditorGUI.DisabledScope(string.IsNullOrEmpty(assetPath))) { + using (new FusionEditorGUI.EnabledScope(!string.IsNullOrEmpty(assetPath))) { position.x += position.width; position.width = 40; @@ -9446,7 +9644,7 @@ protected override void DrawPropertyLayout(GUIContent label) { var objType = Property.ParentType; if (!_cachedGetters.TryGetValue((objType, doIf.ConditionMember), out var getter)) { // maybe this is a top-level property then and we can use reflection? - if (Property.GetDepth() != 0) { + if (Property.GetValueDepth() != 0) { if (doIf.ErrorOnConditionMemberNotFound) { FusionEditorLog.ErrorInspector($"Can't check condition for {Property.Path}: non-SerializedProperty checks only work for top-level properties"); } @@ -9454,13 +9652,15 @@ protected override void DrawPropertyLayout(GUIContent label) { try { _cachedGetters.Add((objType, doIf.ConditionMember), Property.ParentType.CreateGetter(doIf.ConditionMember, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static | BindingFlags.FlattenHierarchy)); } catch (Exception e) { - FusionEditorLog.ErrorInspector($"Can't check condition for {Property.Path}: unable to create getter for {doIf.ConditionMember} with exception {e}"); + if (doIf.ErrorOnConditionMemberNotFound) { + FusionEditorLog.ErrorInspector($"Can't check condition for {Property.Path}: unable to create getter for {doIf.ConditionMember} with exception {e}"); + } } } } if (getter != null) { - foreach (var obj in Property.Parent.ValueEntry.WeakValues) { + foreach (var obj in Property.GetValueParent().ValueEntry.WeakValues) { var value = getter(obj); if (DoIfAttributeDrawer.CheckCondition(doIf, value)) { anyPassed = true; @@ -9913,18 +10113,27 @@ public static bool IsArrayProperty(this InspectorProperty property) { return true; } - public static int GetDepth(this InspectorProperty inspectorProperty) { - int depth = 0; - InspectorProperty currentProperty = inspectorProperty; - - while (currentProperty.Parent != null && !currentProperty.Parent.IsTreeRoot) { - depth++; - currentProperty = currentProperty.Parent; + public static int GetValueDepth(this InspectorProperty property) { + int depth = 0; + + var parent = property.GetValueParent(); + while (parent?.IsTreeRoot == false) { + ++depth; + parent = parent.GetValueParent(); } - + return depth; } + public static InspectorProperty GetValueParent(this InspectorProperty property) { + + var parent = property.Parent; + while (parent?.Info.PropertyType == PropertyType.Group) { + parent = parent.Parent; + } + return parent; + } + public static SerializedPropertyType GetUnityPropertyType(this InspectorProperty inspectorProperty) { if (inspectorProperty == null) { throw new ArgumentNullException(nameof(inspectorProperty)); @@ -9985,11 +10194,11 @@ public static InspectorProperty FindPropertyRelativeToParent(this InspectorPrope int parentIndex = 0; do { - if (referenceProperty.Parent == null) { + if (referenceProperty.GetValueParent() == null) { return null; } - referenceProperty = referenceProperty.Parent; + referenceProperty = referenceProperty.GetValueParent(); } while (path[parentIndex++] == '^'); if (parentIndex > 1) { @@ -10257,7 +10466,7 @@ public NetworkAssetSourceFactoryContext(UnityEngine.Object obj) { #region NetworkAssetSourceFactoryAddressable.cs -#if FUSION_ENABLE_ADDRESSABLES && !FUSION_DISABLE_ADDRESSABLES +#if (FUSION_ADDRESSABLES || FUSION_ENABLE_ADDRESSABLES) && !FUSION_DISABLE_ADDRESSABLES namespace Fusion.Editor { using System; using System.Collections.Generic; @@ -10290,21 +10499,24 @@ protected bool TryCreateInternal(in NetworkAssetSourceFactoryCo readonly Lazy> _guidToParentAddressable = new(() => CreateAddressablesLookup()); static ILookup CreateAddressablesLookup() { - var assetList = new List(); + var assetList = new List(128); var assetsSettings = AddressableAssetSettingsDefaultObject.Settings; if (assetsSettings == null) { throw new System.InvalidOperationException("Unable to load Addressables settings. This may be due to an outdated Addressables version."); } - - foreach (var settingsGroup in assetsSettings.groups) { - if (settingsGroup.ReadOnly) - continue; - settingsGroup.GatherAllAssets(assetList, true, true, true); - } - + + Func groupFilter = null; + CreateAddressablesGroupFilter(ref groupFilter); + Func entryFilter = null; + CreateAddressablesEntryFilter(ref entryFilter); + assetsSettings.GetAllAssets(assetList, true, groupFilter: groupFilter, entryFilter: entryFilter); + return assetList.Where(x => !string.IsNullOrEmpty(x.guid)).ToLookup(x => x.guid); } + + static partial void CreateAddressablesEntryFilter(ref Func filter); + static partial void CreateAddressablesGroupFilter(ref Func filter); } } #endif @@ -11392,12 +11604,6 @@ public unsafe class NetworkObjectEditor : BehaviourEditor { private static PropertyInfo _HasInputAuthority = typeof(NetworkObject).GetPropertyOrThrow(nameof(NetworkObject.HasInputAuthority)); private static PropertyInfo _HasStateAuthority = typeof(NetworkObject).GetPropertyOrThrow(nameof(NetworkObject.HasStateAuthority)); - - [Obsolete("Use " + nameof(NetworkObjectBaker) + " instead", true)] - public static bool BakeHierarchy(GameObject root, NetworkObjectGuid? prefabGuid, Action setDirty = null, Func guidProvider = null) { - throw new NotImplementedException(); - } - static string GetLoadInfoString(NetworkObjectGuid guid) { if (NetworkProjectConfigUtilities.TryGetGlobalPrefabSource(guid, out INetworkPrefabSource prefabSource)) { return prefabSource.Description; @@ -11405,8 +11611,6 @@ static string GetLoadInfoString(NetworkObjectGuid guid) { return "Null"; } - - public override void OnInspectorGUI() { FusionEditorGUI.InjectScriptHeaderDrawer(serializedObject); @@ -11734,8 +11938,6 @@ public class NetworkObjectPostprocessor : AssetPostprocessor { public static event Action OnBakePrefab; public static event Action OnBakeScene; - - private static HashSet s_knownSpawnablePrefabs = new HashSet(); static NetworkObjectPostprocessor() { EditorSceneManager.sceneSaving += OnSceneSaving; @@ -11745,59 +11947,97 @@ static NetworkObjectPostprocessor() { static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths) { FusionEditorLog.TraceImport($"Postprocessing imported assets [{importedAssets.Length}]:\n{string.Join("\n", importedAssets)}"); - bool configPossiblyDirty = false; + bool rebuildPrefabHash = false; - foreach (var path in importedAssets) { - if (!path.EndsWith(".prefab")) { - continue; - } -#if UNITY_2023_1_OR_NEWER - if (Array.IndexOf(movedAssets, path) >= 0) { - // attempting to bake a prefab that has been moved would hang the editor - // TODO: add the bug tracker link once Unity has assigned one + foreach (var path in importedAssets) { + if (!IsPrefabPath(path)) { continue; } -#endif var go = AssetDatabase.LoadAssetAtPath(path); if (!go) { continue; } - + + var isSpawnable = false; + var needsBaking = false; + var no = go.GetComponent(); if (no) { - FusionEditorLog.TraceImport(path, "Was marked as dirty in OnPostprocessPrefab, need to rebake"); - if (BakePrefab(path, out var newRoot)) { -#if FUSION_DEV - Debug.Assert(newRoot != null && newRoot == AssetDatabase.LoadMainAssetAtPath(path)); -#endif - go = newRoot; - no = go.GetComponent(); - } + // NO prefab, needs labels adjusted and hash needs to be rebuilt + rebuildPrefabHash = true; + needsBaking = true; + isSpawnable = !no.Flags.IsIgnored(); } - - var isSpawnable = no && no.Flags.IsIgnored() == false; - var isKnownSpawnablePrefab = isSpawnable && !s_knownSpawnablePrefabs.Add(path); if (AssetDatabaseUtils.SetLabel(go, NetworkProjectConfigImporter.FusionPrefabTag, isSpawnable)) { - configPossiblyDirty = true; + rebuildPrefabHash = true; AssetDatabase.ImportAsset(path); - FusionEditorLog.TraceImport(path, "Labels dirty, going to reimport the config, too"); + FusionEditorLog.TraceImport(path, "Labels were dirty"); } else if (no) { - if (!isKnownSpawnablePrefab) { - // there's still a possible case of prefab being duplicated with the label already in place; - configPossiblyDirty = true; - } FusionEditorLog.TraceImport(path, "Labels up to date"); } + + if (needsBaking) { +#if UNITY_2023_1_OR_NEWER || UNITY_2022_3_OR_NEWER + if (Array.IndexOf(movedAssets, path) >= 0) { + // attempting to bake a prefab that has been moved would hang the editor + // https://issuetracker.unity3d.com/issues/editor-freezes-when-prefabutility-dot-loadprefabcontents-is-called-in-assetpostprocessor-dot-onpostprocessallassets-for-a-moved-prefab + continue; + } +#endif + FusionEditorLog.TraceImport(path, "Baking"); + BakePrefab(path, out _); + } + } + + foreach (var path in movedAssets) { + if (!IsPrefabPath(path)) { + continue; + } + if (!AssetDatabaseUtils.HasLabel(path, NetworkProjectConfigImporter.FusionPrefabTag)) { + continue; + } + rebuildPrefabHash = true; + break; + } + + foreach (var path in deletedAssets) { + if (!IsPrefabPath(path)) { + continue; + } + rebuildPrefabHash = true; + break; } - if (configPossiblyDirty) { - NetworkProjectConfigUtilities.ImportGlobalConfig(); + if (rebuildPrefabHash) { + EditorApplication.delayCall -= NetworkProjectConfigImporter.RefreshNetworkObjectPrefabHash; + EditorApplication.delayCall += NetworkProjectConfigImporter.RefreshNetworkObjectPrefabHash; } } + static bool IsPrefabPath(string path) { + return path.EndsWith(".prefab"); + } + + static bool IsNetworkObjectPrefab(string path, out NetworkObject no) { + if (!path.EndsWith(".prefab")) { + // not a prefab + no = null; + return false; + } + + var go = AssetDatabase.LoadAssetAtPath(path); + if (!go) { + no = null; + return false; + } + + no = go.GetComponent(); + return no; + } + void OnPostprocessPrefab(GameObject prefab) { var no = prefab.GetComponent(); @@ -11881,13 +12121,6 @@ private static void OnSceneSaving(Scene scene, string path) { BakeScene(scene); } - - [Obsolete("Use " + nameof(BakeScene) + " instead")] - public static void BakeSceneObjects(Scene scene) => BakeScene(scene); - - [Obsolete("Use " + nameof(BakeAllOpenScenes) + " instead")] - public static void BakeSceneObjects() => BakeAllOpenScenes(); - [MenuItem("Tools/Fusion/Scene/Bake Scene Objects", false, FusionAssistants.PRIORITY_LOW - 1)] [MenuItem("GameObject/Fusion/Scene/Bake Scene Objects", false, FusionAssistants.PRIORITY - 1)] public static void BakeAllOpenScenes() { @@ -12925,28 +13158,6 @@ public static T GetSubAsset(GameObject prefab) where T : ScriptableObject { public static bool IsSceneObject(GameObject go) { return ReferenceEquals(PrefabStageUtility.GetPrefabStage(go), null) && (PrefabUtility.IsPartOfPrefabAsset(go) == false || PrefabUtility.GetPrefabAssetType(go) == PrefabAssetType.NotAPrefab); } - - public static T SetScriptableObjectType(ScriptableObject obj) where T : ScriptableObject { - if (obj.GetType() == typeof(T)) { - return (T)obj; - } - - var tmp = ScriptableObject.CreateInstance(typeof(T)); - try { - using (var dst = new SerializedObject(obj)) { - using (var src = new SerializedObject(tmp)) { - var scriptDst = dst.FindPropertyOrThrow(FusionEditorGUI.ScriptPropertyName); - var scriptSrc = src.FindPropertyOrThrow(FusionEditorGUI.ScriptPropertyName); - Debug.Assert(scriptDst.objectReferenceValue != scriptSrc.objectReferenceValue); - dst.CopyFromSerializedProperty(scriptSrc); - dst.ApplyModifiedPropertiesWithoutUndo(); - return (T)dst.targetObject; - } - } - } finally { - UnityEngine.Object.DestroyImmediate(tmp); - } - } } } @@ -13177,9 +13388,6 @@ static void PingNetworkProjectConfigAsset() { NetworkProjectConfigUtilities.PingGlobalConfigAsset(true); } - [Obsolete("Use " + nameof(RebuildPrefabTable) + " instead")] - public static void RebuildObjectTable() => RebuildPrefabTable(); - [MenuItem("Tools/Fusion/Rebuild Prefab Table", priority = 100)] public static void RebuildPrefabTable() { foreach (var prefab in AssetDatabase.FindAssets($"t:prefab") @@ -13194,6 +13402,8 @@ public static void RebuildPrefabTable() { AssetDatabase.Refresh(); ImportGlobalConfig(); + + Debug.Log("Rebuild Prefab Table done."); } public static void PingGlobalConfigAsset(bool select = false) { diff --git a/Assets/Photon/Fusion/Editor/FusionEditorSkin.cs b/Assets/Photon/Fusion/Editor/FusionEditorSkin.cs index e8bef8f4ee..f50ac18de5 100644 --- a/Assets/Photon/Fusion/Editor/FusionEditorSkin.cs +++ b/Assets/Photon/Fusion/Editor/FusionEditorSkin.cs @@ -35,7 +35,6 @@ public static FusionEditorSkin instance { public static GUIStyle OutlineBoxStyle => instance.Skin.GetStyle("outline-box"); - public static Color HelpInlineBoxColor => EditorGUIUtility.isProSkin ? new Color(0.317f, 0.337f, 0.352f, 1.000f) : new Color(0.686f, 0.776f, 0.859f); public static Color WarningInlineBoxColor => EditorGUIUtility.isProSkin ? new Color(0.36f, 0.33f, 0.22f, 1.00f) : new Color(0.98f, 0.94f, 0.80f, 0.90f); public static Color ErrorInlineBoxColor => EditorGUIUtility.isProSkin ? new Color(0.40f, 0.15f, 0.10f, 1.00f) : new Color(0.9f, 0.70f, 0.70f, 1.00f); diff --git a/Assets/Photon/Fusion/Editor/FusionHubWindow.cs b/Assets/Photon/Fusion/Editor/FusionHubWindow.cs index f2fb2f6579..c506228966 100644 --- a/Assets/Photon/Fusion/Editor/FusionHubWindow.cs +++ b/Assets/Photon/Fusion/Editor/FusionHubWindow.cs @@ -177,16 +177,16 @@ private void DrawSetupAppIdBox() { GUILayout.Label("Fusion App Id:", GUILayout.Width(120)); var icon = IsAppIdValid() ? CorrectIcon : EditorGUIUtility.FindTexture("console.erroricon.sml"); GUILayout.Label(icon, GUILayout.Width(24), GUILayout.Height(24)); - var editedAppId = EditorGUILayout.DelayedTextField("", realtimeAppId, FusionHubSkin.textField, GUILayout.Height(24)); - if (EditorGUI.EndChangeCheck()) { - if (Guid.TryParse(editedAppId, out _)) { - var currentAppId = realtimeSettings.AppSettings.AppIdFusion; - - if (string.IsNullOrEmpty(currentAppId) || currentAppId.Equals(editedAppId) == false) { - VSAttribution.SendAttributionEvent(editedAppId); - } + var editedAppId = EditorGUILayout.TextField("", realtimeAppId, FusionHubSkin.textField, GUILayout.Height(24)); + + // Check for changes and validate the AppId + if (EditorGUI.EndChangeCheck() && Guid.TryParse(editedAppId, out _)) { + // Send attribution event if the AppId has changed + if (string.IsNullOrEmpty(realtimeAppId) || realtimeAppId.Equals(editedAppId) == false) { + VSAttribution.SendAttributionEvent(editedAppId); } + // Update the AppId realtimeSettings.AppSettings.AppIdFusion = editedAppId; EditorUtility.SetDirty(realtimeSettings); AssetDatabase.SaveAssets(); diff --git a/Assets/Photon/Fusion/Editor/NetworkProjectConfigImporter.cs b/Assets/Photon/Fusion/Editor/NetworkProjectConfigImporter.cs index 37e56032e9..86e1e41887 100644 --- a/Assets/Photon/Fusion/Editor/NetworkProjectConfigImporter.cs +++ b/Assets/Photon/Fusion/Editor/NetworkProjectConfigImporter.cs @@ -19,6 +19,7 @@ public class NetworkProjectConfigImporter : ScriptedImporter { public const string FusionPrefabTagSearchTerm = "l:FusionPrefab"; public const string ScriptOrderDependencyName = "Fusion.ScriptOrderDependency"; public const string AddressablesDependencyName = "Fusion.AddressablesDependency"; + public const string PrefabsDependencyName = "Fusion.PrefabsDependency"; [Header("Prefabs")] [DrawInline] @@ -49,6 +50,7 @@ public override void OnImportAsset(AssetImportContext ctx) { ctx.DependsOnCustomDependency(AddressablesDependencyName); ctx.DependsOnCustomDependency(ScriptOrderDependencyName); + ctx.DependsOnCustomDependency(PrefabsDependencyName); } @@ -89,9 +91,7 @@ private static List DiscoverPrefabs(AssetImportContext ctx #if FUSION_EDITOR_TRACE detailsLog.AppendLine($"{assetPath} -> {((INetworkPrefabSource)prefabSource).EditorSummary}"); #endif - - ctx.DependsOnSourceAsset(prefabPath); - + var index = paths.BinarySearch(prefabPath, StringComparer.Ordinal); if (index < 0) { index = ~index; @@ -214,5 +214,17 @@ private static Hash128 CalculateScriptOrderDependencyHash() { return hash; } } + + public static void RefreshNetworkObjectPrefabHash() { + var hash = new Hash128(); + + foreach (var it in AssetDatabaseUtils.IterateAssets(label: FusionPrefabTag)) { + hash.Append(it.guid); + } + + FusionEditorLog.TraceImport($"Refreshing {PrefabsDependencyName} dependency hash: {hash}"); + AssetDatabase.RegisterCustomDependency(PrefabsDependencyName, hash); + AssetDatabase.Refresh(); + } } } diff --git a/Assets/Photon/Fusion/Editor/NetworkProjectConfigImporterEditor.cs b/Assets/Photon/Fusion/Editor/NetworkProjectConfigImporterEditor.cs index a5451dcaf0..ea6b2a0795 100644 --- a/Assets/Photon/Fusion/Editor/NetworkProjectConfigImporterEditor.cs +++ b/Assets/Photon/Fusion/Editor/NetworkProjectConfigImporterEditor.cs @@ -35,6 +35,7 @@ public override void OnInspectorGUI() { using (new EditorGUI.DisabledScope(HasModified())) { if (GUILayout.Button("Rebuild Prefab Table")) { NetworkProjectConfigUtilities.RebuildPrefabTable(); + GUIUtility.ExitGUI(); } } @@ -52,11 +53,14 @@ public override void OnInspectorGUI() { if (GUILayout.Button("Show Network Prefabs Inspector")) { NetworkPrefabsInspector.ShowWindow(); } - + // WORKAROUND: during initial failed imports, this may be an instance of UnityEngine.DefaultAsset instead of the actual asset - if (assetSerializedObject.targetObject.GetType() == typeof(NetworkProjectConfigAsset)) { - EditorGUILayout.PropertyField(assetSerializedObject.FindPropertyOrThrow(nameof(NetworkProjectConfigAsset.Prefabs))); - EditorGUILayout.PropertyField(assetSerializedObject.FindPropertyOrThrow(nameof(NetworkProjectConfigAsset.BehaviourMeta))); + if (assetSerializedObject?.targetObject.GetType() == typeof(NetworkProjectConfigAsset)) { + // this has the tendency to overwrite the global enabled flag, so let's make sure it's reset once the scope exists + using (new FusionEditorGUI.EnabledScope(GUI.enabled)) { + EditorGUILayout.PropertyField(assetSerializedObject.FindPropertyOrThrow(nameof(NetworkProjectConfigAsset.Prefabs))); + EditorGUILayout.PropertyField(assetSerializedObject.FindPropertyOrThrow(nameof(NetworkProjectConfigAsset.BehaviourMeta))); + } } else { EditorGUILayout.HelpBox("Asset failed to deserialize correctly. Please reimport.", MessageType.Warning); } diff --git a/Assets/Photon/Fusion/PhotonFusion-Documentation.pdf b/Assets/Photon/Fusion/PhotonFusion-Documentation.pdf index ed55f11bcd..d0c80a781c 100644 Binary files a/Assets/Photon/Fusion/PhotonFusion-Documentation.pdf and b/Assets/Photon/Fusion/PhotonFusion-Documentation.pdf differ diff --git a/Assets/Photon/Fusion/PhotonFusion-Documentation.pdf.meta b/Assets/Photon/Fusion/PhotonFusion-Documentation.pdf.meta index 7de0c3f29d..7b551fd2cd 100644 --- a/Assets/Photon/Fusion/PhotonFusion-Documentation.pdf.meta +++ b/Assets/Photon/Fusion/PhotonFusion-Documentation.pdf.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 050ed527af025f1498df0e8331ac34e9 +guid: 9faec9e84c7e4974a8922d6c5f6cb37a DefaultImporter: externalObjects: {} userData: diff --git a/Assets/Photon/Fusion/Resources/NetworkProjectConfig.fusion.meta b/Assets/Photon/Fusion/Resources/NetworkProjectConfig.fusion.meta index 95f59222ff..476e6c86d5 100644 --- a/Assets/Photon/Fusion/Resources/NetworkProjectConfig.fusion.meta +++ b/Assets/Photon/Fusion/Resources/NetworkProjectConfig.fusion.meta @@ -6,9 +6,9 @@ ScriptedImporter: internalIDToNameTable: [] externalObjects: {} serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: + userData: + assetBundleName: + assetBundleVariant: script: {fileID: 11500000, guid: 66a64a17d0b40f34f9224317a5a84bf2, type: 3} PrefabOptions: UnloadPrefabOnReleasingLastInstance: 0 diff --git a/Assets/Photon/Fusion/Runtime/Fusion.Unity.cs b/Assets/Photon/Fusion/Runtime/Fusion.Unity.cs index a7f8d7115d..d5140f1815 100644 --- a/Assets/Photon/Fusion/Runtime/Fusion.Unity.cs +++ b/Assets/Photon/Fusion/Runtime/Fusion.Unity.cs @@ -6,7 +6,7 @@ #region NetworkAssetSourceAddressable.cs -#if FUSION_ENABLE_ADDRESSABLES && !FUSION_DISABLE_ADDRESSABLES +#if (FUSION_ADDRESSABLES || FUSION_ENABLE_ADDRESSABLES) && !FUSION_DISABLE_ADDRESSABLES namespace Fusion { using System; #if UNITY_EDITOR @@ -80,8 +80,9 @@ private void LoadInternal(bool synchronous) { } private void UnloadInternal() { - Debug.Assert(Address.IsValid()); - Address.ReleaseAsset(); + if (Address.IsValid()) { + Address.ReleaseAsset(); + } } private T ValidateResult(object result) { @@ -1408,7 +1409,7 @@ public struct FieldMaskData { private static Dictionary s_lookup = new (); - public static FieldMaskData Lookup(this Type type) { + private static FieldMaskData Lookup(this Type type) { if (type == typeof(SimulationStats)) return Lookup(StatSourceTypes.Simulation); if (type == typeof(BehaviourStats)) return Lookup(StatSourceTypes.Behaviour); if (type == typeof(SimulationConnectionStats)) return Lookup(StatSourceTypes.NetConnection); @@ -1634,7 +1635,7 @@ public FieldInfo FieldInfo { private object _statsObject; private NetworkObject _previousNetworkObject; - public object StatsObject { + protected object StatsObject { get { if (_statsObject != null && _previousNetworkObject == _fusionStats.Object) { @@ -1652,14 +1653,14 @@ public object StatsObject { var no = _fusionStats.Object; // GetComponentInParent(); if (no != _previousNetworkObject) { if (no) { - _previousNetworkObject = no; - runner.TryGetObjectStats(no.Id, out var stats); + if (runner.TryGetObjectStats(no.Id, out var stats)) { + _previousNetworkObject = no; + } return _statsObject = stats; } _previousNetworkObject = null; return _statsObject = default; } - return _statsObject; } case StatSourceTypes.NetConnection: { @@ -1703,7 +1704,7 @@ public virtual void Initialize() { } - public virtual void CyclePer() { + protected virtual void CyclePer() { switch (CurrentAveraging) { case StatAveraging.PerSample: diff --git a/Assets/Photon/Fusion/Runtime/FusionStatsGraph.cs b/Assets/Photon/Fusion/Runtime/FusionStatsGraph.cs index 86772c54ba..aa1653d13d 100644 --- a/Assets/Photon/Fusion/Runtime/FusionStatsGraph.cs +++ b/Assets/Photon/Fusion/Runtime/FusionStatsGraph.cs @@ -197,7 +197,7 @@ void ResetGraphShader() { } } - public override void CyclePer() { + protected override void CyclePer() { base.CyclePer(); SetAveragingText(); } @@ -248,7 +248,7 @@ void UpdateGraph() { } - // Boxing.. yay fun. Would be nice to be able to get values from OverTimeStatsBuffer by index + // Boxing here... Would be nice to be able to get values from OverTimeStatsBuffer by index var statsBuffer = (OverTimeStatBuffer)FieldInfo.GetValue(StatsObject); var values = _values; diff --git a/Assets/Photon/Fusion/Runtime/NetworkCharacterController.cs b/Assets/Photon/Fusion/Runtime/NetworkCharacterController.cs index aefc8da7f1..2356fb1c8e 100644 --- a/Assets/Photon/Fusion/Runtime/NetworkCharacterController.cs +++ b/Assets/Photon/Fusion/Runtime/NetworkCharacterController.cs @@ -110,6 +110,7 @@ public void Move(Vector3 direction) { public override void Spawned() { _initial = default; TryGetComponent(out _controller); + CopyToBuffer(); } public override void Render() { diff --git a/Assets/Photon/Fusion/Runtime/Utilities/RunnerVisibility/EnableOnSingleRunner.cs b/Assets/Photon/Fusion/Runtime/Utilities/RunnerVisibility/EnableOnSingleRunner.cs index 0348e156ad..1d7ce6e4df 100644 --- a/Assets/Photon/Fusion/Runtime/Utilities/RunnerVisibility/EnableOnSingleRunner.cs +++ b/Assets/Photon/Fusion/Runtime/Utilities/RunnerVisibility/EnableOnSingleRunner.cs @@ -17,38 +17,6 @@ namespace Fusion { [AddComponentMenu("Fusion/Enable On Single Runner")] public class EnableOnSingleRunner : Fusion.Behaviour { - - - // ------------------------------- Delete this in the future ---------------------- - // TODO: Only here for transition from RunnerVisibilityNodes: -#pragma warning disable CS0618 - private static bool Upgrade(RunnerVisibilityNodes old, GameObject go) { - Debug.LogWarning($"Upgrading {go.name} {old._guid}"); -#if UNITY_EDITOR - var existingNew = go.GetComponents(); - foreach (var c in existingNew) { - if (c._guid == old._guid) { - // already upgraded - return false; - } - } - var upgraded = Undo.AddComponent(go); - upgraded._guid = old._guid; - upgraded.Components = old.Components; - upgraded.PreferredRunner = (RunnerVisibilityLink.PreferredRunners)old.PreferredRunner; - - EditorUtility.SetDirty(upgraded); - - return true; -#else - return false; -#endif - } -#pragma warning restore CS0618 - // ------------------------------- Delete this in the future ---------------------- - - - /// /// If more than one runner instance is visible, this indicates which peer's clone of this entity should be visible. /// diff --git a/Assets/Photon/Fusion/Runtime/Utilities/RunnerVisibility/RunnerVisibilityLink.cs b/Assets/Photon/Fusion/Runtime/Utilities/RunnerVisibility/RunnerVisibilityLink.cs index 81e63276bd..2415f9c6ad 100644 --- a/Assets/Photon/Fusion/Runtime/Utilities/RunnerVisibility/RunnerVisibilityLink.cs +++ b/Assets/Photon/Fusion/Runtime/Utilities/RunnerVisibility/RunnerVisibilityLink.cs @@ -22,26 +22,6 @@ public interface IRunnerVisibilityRecognizedType { [AddComponentMenu("")] public sealed class RunnerVisibilityLink : MonoBehaviour { - [StaticField(StaticFieldResetMode.None)] - [Obsolete] - private static readonly System.Type[] _recognizedBehaviourTypes = { - typeof(IRunnerVisibilityRecognizedType), - typeof(Renderer), - typeof(AudioListener), - typeof(Camera), - typeof(Canvas), - typeof(Light) - }; - - /// - /// Types that fusion.runtime isn't aware of, which need to be found using names instead. - /// - [StaticField(StaticFieldResetMode.None)] - [Obsolete] - private static readonly string[] _recognizedBehaviourNames = { - "EventSystem" - }; - /// /// The peer runner that will be used if more than one runner is visible, and this node was manually added by developer (indicating only one instance should be visible at a time). /// diff --git a/Assets/Photon/Fusion/build_info.txt b/Assets/Photon/Fusion/build_info.txt index 118bf3068a..311e4e33c9 100644 --- a/Assets/Photon/Fusion/build_info.txt +++ b/Assets/Photon/Fusion/build_info.txt @@ -1,3 +1,3 @@ -build: 2.0.0 RC 797 -date: 2023-11-07 18:22:01 -git: 2.0/develop (5bb4ea865) \ No newline at end of file +build: 2.0.0 RC 801 +date: 2023-12-12 14:08:42 +git: 2.0/develop (2e3e0ad8a) \ No newline at end of file diff --git a/Assets/Photon/Fusion/release_history.txt b/Assets/Photon/Fusion/release_history.txt index be281e90a0..4147518cc9 100644 --- a/Assets/Photon/Fusion/release_history.txt +++ b/Assets/Photon/Fusion/release_history.txt @@ -109,6 +109,43 @@ For a more in-depth overview over what changed check: [Coming from Fusion 1.0](h ## RC +### Build 801 (Dec 12, 2023) + +**Changes** + +- `NetworkRigidbody` XML Docs +- `NetworkProjectConfigImporter` refreshes now whenever a new `NetworkObject` prefab is created, a prefab is moved or deleted +- NetworkRigidbody EnsurerHasRunnerSimulatePhysics() changed from private to protected +- _deferredTeleport field in NetworkRigidbody changed from private to protected + +**Removed** + +- Obsolete API + +**Bug Fixes** + +- Fixed: NetworkCharacterController Spawn at 0,0,0 +- Fixed: Issue with full consistency not acting properly when ReplicateTo was being used +- Fixed: NetworkObjects not being replicated on clients correctly when scheduling only enabled +- Fixed: Revert & Apply buttons always disabled in `NetworkProjectConfig` inspector +- Fixed: Odin: inspector errors for `[Networked]` properties when using `[FoldoutGroups]` +Dev: Imported PhotonUnityEditorCommon@f81d7ff1bfa4ef962bd64e664a3c50a44e922404 +- Fixed: FusionStats NetworkObject stats would always fail to find stat data, now will correctly retry until found +- Fixed: NetworkRigidbody fixed so State Authority changes in Shared Mode retain Rigidbody velocity on the new State Authority +- Fixed: Timming issue with master client objects state authority changed detection +- Fixed: NetworkRigidbody now un-dirties the interpolation target when SetInterpolationTarget(null) is called. This prevents null errors due to setting the target to null at runtime +- Fixed: Test Suit Platforms +- Fixed: `NullReferenceException` thrown by `NetworkProjectConfigImporterEditor` if initial prefab table import fails +- Fixed: NetworkRigidbody3D ResetRigidbody() now checks for isKinematic before reseting velocity +- Fixed: Change detector having incorrect ticks set +- Fixed: "InvalidOperationException" during connection establishing on server +- Fixed: Allocations in Timelines.Update +- Fixed: Allocations in Client.GetInput +- Fixed: Invalid properties when NetworkRunner is Uninitialized +- Fixed: NRB handling of unparented Kinematic RBs now always applies pos/rot to Transform rather than Rigidbody +- Fixed: Fusion.Addon.Physics assembly correctly renamed in NetworkProjectConfig.AssembliesToWeave defaults +- Fixed: Editor freezing on prefab rename workaround applied to Unity 2022.3 as well + ### Build 797 (Nov 07, 2023) **What's New** diff --git a/Assets/Photon/Fusion/Demos/BasicNetworkSetup.unity.meta b/Assets/Photon/FusionAddons/Photon-Fusion-Physics-Addon-2.0.0-RC-801.unitypackage.meta similarity index 74% rename from Assets/Photon/Fusion/Demos/BasicNetworkSetup.unity.meta rename to Assets/Photon/FusionAddons/Photon-Fusion-Physics-Addon-2.0.0-RC-801.unitypackage.meta index a0a13600c0..c451eee47f 100644 --- a/Assets/Photon/Fusion/Demos/BasicNetworkSetup.unity.meta +++ b/Assets/Photon/FusionAddons/Photon-Fusion-Physics-Addon-2.0.0-RC-801.unitypackage.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 2ec534fc2617ad245b9eb5f94e2d27a0 +guid: bef43079427060641b9a90d2f29edc8f DefaultImporter: externalObjects: {} userData: diff --git a/Assets/Photon/FusionAddons/Photon-Fusion-TestSuit-Addon-2.0.0-RC-801.unitypackage.meta b/Assets/Photon/FusionAddons/Photon-Fusion-TestSuit-Addon-2.0.0-RC-801.unitypackage.meta new file mode 100644 index 0000000000..5088206c00 --- /dev/null +++ b/Assets/Photon/FusionAddons/Photon-Fusion-TestSuit-Addon-2.0.0-RC-801.unitypackage.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: a2727ac14e2b10b45bcf649997c9f331 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Photon/Fusion/Demos.meta b/Assets/Photon/FusionDemos.meta similarity index 77% rename from Assets/Photon/Fusion/Demos.meta rename to Assets/Photon/FusionDemos.meta index 239c4199c8..8b53b157aa 100644 --- a/Assets/Photon/Fusion/Demos.meta +++ b/Assets/Photon/FusionDemos.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: ead386e044504634db4f0d5e2fe2838d +guid: 366ee4d8934f6194981da2f177c87fe9 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/Photon/FusionDemos/Photon-Fusion-Intro-Sample-2.0.0-RC-801.unitypackage.meta b/Assets/Photon/FusionDemos/Photon-Fusion-Intro-Sample-2.0.0-RC-801.unitypackage.meta new file mode 100644 index 0000000000..da9c518a50 --- /dev/null +++ b/Assets/Photon/FusionDemos/Photon-Fusion-Intro-Sample-2.0.0-RC-801.unitypackage.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: de43c404ae18d6043ae5dc7a00e6a0ab +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Prefabs/Static/Lava.prefab.meta b/Assets/Resources/Prefabs/Static/Lava.prefab.meta index bf5a99f1f2..44f47256ef 100644 --- a/Assets/Resources/Prefabs/Static/Lava.prefab.meta +++ b/Assets/Resources/Prefabs/Static/Lava.prefab.meta @@ -1,5 +1,7 @@ fileFormatVersion: 2 guid: 115442ccb2e124e4bb651a64613cec68 +labels: +- FusionPrefab PrefabImporter: externalObjects: {} userData: diff --git a/Assets/Resources/Prefabs/Static/MarioBrosPlatform.prefab b/Assets/Resources/Prefabs/Static/MarioBrosPlatform.prefab index 21274b5afe..0871ef91c4 100644 --- a/Assets/Resources/Prefabs/Static/MarioBrosPlatform.prefab +++ b/Assets/Resources/Prefabs/Static/MarioBrosPlatform.prefab @@ -164,9 +164,7 @@ MonoBehaviour: m_EditorClassIdentifier: SortKey: 3611325487 ObjectInterest: 1 - _DestroyWhenStateAuthorityLeaves: 0 - _AllowStateAuthorityOverride: 0 - Flags: 2305 + Flags: 1 NestedObjects: [] NetworkedBehaviours: - {fileID: 717523893114735357} diff --git a/Assets/Resources/Prefabs/Static/Poison.prefab b/Assets/Resources/Prefabs/Static/Poison.prefab index da31babb9a..47545b2c32 100644 --- a/Assets/Resources/Prefabs/Static/Poison.prefab +++ b/Assets/Resources/Prefabs/Static/Poison.prefab @@ -173,9 +173,7 @@ MonoBehaviour: m_EditorClassIdentifier: SortKey: 3357233732 ObjectInterest: 1 - _DestroyWhenStateAuthorityLeaves: 0 - _AllowStateAuthorityOverride: 0 - Flags: 67841 + Flags: 1 NestedObjects: [] NetworkedBehaviours: - {fileID: 2500780753419200967} diff --git a/Assets/Resources/Prefabs/Static/Poison.prefab.meta b/Assets/Resources/Prefabs/Static/Poison.prefab.meta index b7fe9e50f0..40d89401b3 100644 --- a/Assets/Resources/Prefabs/Static/Poison.prefab.meta +++ b/Assets/Resources/Prefabs/Static/Poison.prefab.meta @@ -1,5 +1,7 @@ fileFormatVersion: 2 guid: 2dd296828f2080541ab2b41eeda650a7 +labels: +- FusionPrefab PrefabImporter: externalObjects: {} userData: diff --git a/Assets/Scenes/MainMenu.unity b/Assets/Scenes/MainMenu.unity index 431973ace2..19afa59d05 100644 --- a/Assets/Scenes/MainMenu.unity +++ b/Assets/Scenes/MainMenu.unity @@ -2343,10 +2343,10 @@ RectTransform: m_Father: {fileID: 823064026} m_RootOrder: -1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 24} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 130, y: -484} + m_SizeDelta: {x: 260, y: 24} m_Pivot: {x: 0.5, y: 1} --- !u!114 &66575388 MonoBehaviour: @@ -2481,9 +2481,9 @@ RectTransform: m_Father: {fileID: 698007182} m_RootOrder: -1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 130, y: -110} m_SizeDelta: {x: 260, y: 24} m_Pivot: {x: 0.5, y: 1} --- !u!114 &75133766 @@ -2633,9 +2633,9 @@ RectTransform: m_Father: {fileID: 698007182} m_RootOrder: -1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 130, y: -136} m_SizeDelta: {x: 260, y: 24} m_Pivot: {x: 0.5, y: 1} --- !u!114 &75580657 @@ -2784,9 +2784,9 @@ RectTransform: m_Father: {fileID: 698007182} m_RootOrder: -1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 130, y: -188} m_SizeDelta: {x: 260, y: 24} m_Pivot: {x: 0.5, y: 1} --- !u!114 &77529301 @@ -2934,10 +2934,10 @@ RectTransform: m_Father: {fileID: 823064026} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 30} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 130, y: -19} + m_SizeDelta: {x: 260, y: 30} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &80074248 MonoBehaviour: @@ -3975,9 +3975,9 @@ RectTransform: m_Father: {fileID: 698007182} m_RootOrder: -1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 130, y: -15} m_SizeDelta: {x: 260, y: 30} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &153817299 @@ -6885,9 +6885,9 @@ RectTransform: m_Father: {fileID: 698007182} m_RootOrder: -1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 130, y: -32} m_SizeDelta: {x: 260, y: 24} m_Pivot: {x: 0.5, y: 1} --- !u!114 &256353508 @@ -14164,9 +14164,9 @@ RectTransform: m_Father: {fileID: 698007182} m_RootOrder: -1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 130, y: -255} m_SizeDelta: {x: 260, y: 30} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &402645375 @@ -15608,10 +15608,10 @@ RectTransform: m_Father: {fileID: 823064026} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 34} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 130, y: -98} + m_SizeDelta: {x: 260, y: 34} m_Pivot: {x: 0.5, y: 1} --- !u!114 &438218786 MonoBehaviour: @@ -17040,10 +17040,10 @@ RectTransform: m_Father: {fileID: 823064026} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 24} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 130, y: -36} + m_SizeDelta: {x: 260, y: 24} m_Pivot: {x: 0.5, y: 1} --- !u!114 &485322299 MonoBehaviour: @@ -23536,10 +23536,10 @@ RectTransform: m_Father: {fileID: 823064026} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 34} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 130, y: -62} + m_SizeDelta: {x: 260, y: 34} m_Pivot: {x: 0.5, y: 1} --- !u!114 &574816556 MonoBehaviour: @@ -24778,10 +24778,10 @@ RectTransform: m_Father: {fileID: 823064026} m_RootOrder: 8 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 24} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 130, y: -134} + m_SizeDelta: {x: 260, y: 24} m_Pivot: {x: 0.5, y: 1} --- !u!114 &644584041 MonoBehaviour: @@ -26682,10 +26682,10 @@ RectTransform: m_Father: {fileID: 823064026} m_RootOrder: -1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 0, y: -321} + m_SizeDelta: {x: 260, y: 322} m_Pivot: {x: 0, y: 0.5} --- !u!114 &698007183 MonoBehaviour: @@ -28213,9 +28213,9 @@ RectTransform: m_Father: {fileID: 698007182} m_RootOrder: -1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 130, y: -84} m_SizeDelta: {x: 260, y: 24} m_Pivot: {x: 0.5, y: 1} --- !u!114 &745954561 @@ -36971,9 +36971,9 @@ RectTransform: m_Father: {fileID: 698007182} m_RootOrder: -1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 130, y: -214} m_SizeDelta: {x: 260, y: 24} m_Pivot: {x: 0.5, y: 1} --- !u!114 &899502179 @@ -43992,9 +43992,9 @@ RectTransform: m_Father: {fileID: 698007182} m_RootOrder: -1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 130, y: -298} m_SizeDelta: {x: 260, y: 24} m_Pivot: {x: 0.5, y: 1} --- !u!114 &1259822364 @@ -49736,9 +49736,9 @@ RectTransform: m_Father: {fileID: 698007182} m_RootOrder: -1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 130, y: -58} m_SizeDelta: {x: 260, y: 24} m_Pivot: {x: 0.5, y: 1} --- !u!114 &1488925096 @@ -75174,9 +75174,9 @@ RectTransform: m_Father: {fileID: 698007182} m_RootOrder: -1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 130, y: -284} m_SizeDelta: {x: 260, y: 24} m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &1585506762 @@ -75848,7 +75848,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: -0.000030517578} + m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0, y: 0} --- !u!114 &1603668786 @@ -82440,7 +82440,7 @@ MonoBehaviour: m_TargetGraphic: {fileID: 1141870934} m_HandleRect: {fileID: 1141870933} m_Direction: 2 - m_Value: 1 + m_Value: 0 m_Size: 1 m_NumberOfSteps: 0 m_OnValueChanged: @@ -89285,9 +89285,9 @@ RectTransform: m_Father: {fileID: 698007182} m_RootOrder: -1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 130, y: -162} m_SizeDelta: {x: 260, y: 24} m_Pivot: {x: 0.5, y: 1} --- !u!114 &2007433170 diff --git a/Assets/Scripts/BuildInfo.cs b/Assets/Scripts/BuildInfo.cs index 6147ce51c7..895b012844 100644 --- a/Assets/Scripts/BuildInfo.cs +++ b/Assets/Scripts/BuildInfo.cs @@ -1 +1 @@ -public static class BuildInfo{public static string BUILD_TIME = "12/5/2023 5:53:23 AM";} +public static class BuildInfo{public static string BUILD_TIME = "12/13/2023 11:58:13 PM";} diff --git a/Assets/Scripts/GlobalController.cs b/Assets/Scripts/GlobalController.cs index e22d8925dd..41c7efee93 100644 --- a/Assets/Scripts/GlobalController.cs +++ b/Assets/Scripts/GlobalController.cs @@ -73,7 +73,6 @@ public void Start() { ControlSystem.controls.Debug.FPSMonitor.performed += ToggleFpsMonitor; NetworkHandler.OnShutdown += OnShutdown; - NetworkHandler.OnPlayerJoined += OnPlayerJoined; NetworkHandler.OnHostMigration += OnHostMigration; CreateFusionStatsInstance(); @@ -84,7 +83,6 @@ public void OnDestroy() { ControlSystem.controls.Disable(); NetworkHandler.OnShutdown -= OnShutdown; - NetworkHandler.OnPlayerJoined -= OnPlayerJoined; NetworkHandler.OnHostMigration -= OnHostMigration; } @@ -122,16 +120,36 @@ public void Update() { #endif } +#if UNITY_WEBGL + int previousVsyncCount; + int previousFrameRate; +#endif + public void OnApplicationFocus(bool focus) { if (focus) { Settings.Instance.ApplyVolumeSettings(); StopCoroutineNullable(ref fadeMusicRoutine); StopCoroutineNullable(ref fadeSfxRoutine); + +#if UNITY_WEBGL + // Lock framerate when losing focus to (hopefully) disable browsers slowing the game + previousVsyncCount = QualitySettings.vSyncCount; + previousFrameRate = Application.targetFrameRate; + + QualitySettings.vSyncCount = 0; + Application.targetFrameRate = 30; +#endif + } else { if (Settings.Instance.audioMuteMusicOnUnfocus) fadeMusicRoutine ??= StartCoroutine(FadeVolume("MusicVolume")); if (Settings.Instance.audioMuteSFXOnUnfocus) fadeSfxRoutine ??= StartCoroutine(FadeVolume("SoundVolume")); + +#if UNITY_WEBGL + QualitySettings.vSyncCount = previousVsyncCount; + Application.targetFrameRate = previousFrameRate; +#endif } } @@ -184,16 +202,6 @@ private void OnHostMigration(NetworkRunner runner, HostMigrationToken token) { CreateFusionStatsInstance(); } - private void OnPlayerJoined(NetworkRunner runner, PlayerRef player) { - if (runner.LocalPlayer != player) - return; - - // Fixed bugged layout if the graph was already open. - Debug.Log(fusionStats); - fusionStats.GetComponent().PlayerRef = player; - } - - private void ToggleFpsMonitor(InputAction.CallbackContext obj) { graphy.SetActive(!graphy.activeSelf); } diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index a9f53f10f3..e94a506ead 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -813,7 +813,7 @@ PlayerSettings: QNX: Stadia: Standalone: FUSION_WEAVER;FUSION2 - WebGL: FUSION_WEAVER + WebGL: FUSION_WEAVER;FUSION2 Windows Store Apps: FUSION_WEAVER XboxOne: iPhone: