* adding MakeGeneric method
* adding tests for NB syncvar+hook
* adding functions to NetworkBehaviour
* getting references to new functions
* fixing NB read so it always reads same number of bytes as write
* adding backing field and serialize for Nb Syncvar
* extra test
* adding ignore to transform test
* fixing test
Seems like this has come up a few times so here is a commit to sort this out.
We shouldn't have to worry about the order of the using, we should just let plugins automatically sort them. They are sorted into alphabetical order expect for system becase we have `dotnet_sort_system_directives_first = true` enabled in `.editorconfig`
* fix: stopping values being reset before OnDestory is called
* matches server side logic
* if an object is being fully destroyed it doesn't need its values to be reset
* adding read/write functions
* adding method to get WriteNetworkBehaviour
* adding methods to weavertypes
* adding method to get ReadNetworkBehaviour
* weaver test for NetworkBehaviour in RPC
* renaming var
* writing tests to make sure read/write works
* registering functions
* changing function and adding comment
* checking any writer is set
* adding Description to test
* collection test
* fixing call
* removing errors, networkbehaviour as read/write
* adding test to use the reader that weaver generates
* fixing import
* simplifying test
* removing null from spawned
* improving throw
* adding code coverage
* applying code suggestions
* Using TypeReference with IEqualityComparer instead of string to keep reference to type
* using targetType to initialize write/read functions
* test to make sure write function is set
```
UnityException: ToString is not allowed to be called from a MonoBehaviour constructor (or instance field initializer), call it in Awake or Start instead. Called from MonoBehaviour 'GamePlay' on game object 'GamePlay'.
See "Script Serialization" page in the Unity Manual for further details.
UnityEngine.Object.ToString () (at <a979f18d51af41179d12b797e8c5be14>:0)
UnityEngine.Logger.GetString (System.Object message) (at <a979f18d51af41179d12b797e8c5be14>:0)
UnityEngine.Logger.LogError (System.String tag, System.Object message) (at <a979f18d51af41179d12b797e8c5be14>:0)
Mirror.NetworkBehaviour.InitSyncObject (Mirror.SyncObject syncObject) (at Assets/System/3rdParty/Mirror/Runtime/NetworkBehaviour.cs:168)
myGame.GamePlay..ctor () (at Assets/System/GamePlay.cs:18)
```
- consolidate nested if
- set kinematic by default on scene objects
- set kinematic false on server in AddForce::Start
- added field for Rigidbody component reference via inspector
- eliminated calling GetComponent every frame
- set SyncInverval to zero on both NetworkTransforms and NetworkRigidbody
* Mention Custom UDP SG rule for Kcp Transport
Since Kcp Transport is now the default in Mirror, let's update the docs to reflect that the SG needs to have a UDP rule to allow network traffic to reach the server.
* Mention UDP Firewall rule for Kcp Transport
Since Kcp Transport is now the default in Mirror, let's update the docs to reflect that a UDP rule is necessary in order to allow network traffic to reach the server.
* Changed oldColor to underscore in hook in RandomColor
* WIP
* feat: Updated Basic Example
- PlayerUI is now separated from player object
- PlayerUI is event driven from the Player object
- PlayerUI is locally instantiated, instead of networked
- added border to players panel
* fixed code smells
* moved playersList to BasicNetManager
* fixed compile error and improved layout
* fixed tooltips
Co-authored-by: MrGadget1024 <chris@clevertech.net>
Having near identical lines in these functions is confusing at first glace. Having RegisterWriteFunc call Register makes it more clear exactly what is going on