NetworkVariable's or any other MLAPI related task that requires serialization. The MLAPI uses a default serialization pipeline that looks like this:
Custom Types => Built In Types => INetworkSerializable
That is, when the MLAPI first gets hold of a type, it will check for any custom types that the user have registered for serialization, after that it will check if it's a built in type, such as a Vector3, float etc. These are handled by default. If not, it will check if the type inherits INetworkSerializable, if it does, it will call it's write methods.
The builtin types that are handled by default are:
- Nullable types where the underlying type is supported
- An array where the element type is supported (can be multi dimensional as this is done recursivley)
- GameObject (Only if the GameObject has a NetworkObject component that is spawned)
- NetworkObject (Only if spawned)
- NetworkBehaviour (Only if spawned)
With this flow, you can override ALL serialization for ALL types, even built in types, and with the API provided, it can even be done with types that you have not defined yourself, those who are behind a 3rd party wall, such as .NET types.
To register a custom type, or override an already handeld type you need to register a handler pair.
When you call the Register method, you override any previous serialization method previously defined by you, or the MLAPI library. This is the most respected serialization method.
You can also restore privilages to how they were previously for a type.