Closed WhippetsAintDogs closed 1 year ago
To make this feature work out of the box, we could update this repo's dependency to NGO to 1.0.0 (stable) and actually add the assembly definition reference file I've mentionned in the previous comment. What do you think about that, guys ?
Some clarification of the @WhippetsAintDogs solution as it may not be entirely clear - create e.g. folder "NetworkDictionary" in your solution in Scripts folder. Move NetworkDictionary.cs class there and create NetworkDictionary.asmref with this code:
{ "reference": "Unity.Netcode.Runtime" }
or via Unity Editor:
It may not be the best solution, but it works for me. Thanks @WhippetsAintDogs for your pull request. Thanks to you I didn't get a headache while solving this problem! :)
@PrarR @WhippetsAintDogs these comments are great, but once this is merged no one will see them. Maybe add them as a README.md in the NetworkDictionary folder? Would also be great if NetworkDictionary would be conditionally compiled (disabled by default) so that there are no compile errors as soon as people install the package. Right now when people install the package they are forced to take action and fix NetworkDictionary even if they're not using it :shrug:
@JesseOlmer it's done ! 😄
internal static void Write
andinternal static void Read
methods of thepublic static class NetworkVariableSerialization<T>
(NetworkVariableSerialization.cs) of the NGO's package have to be madepublic
in order to make this implementation work.OR
You can add an Assembly definition reference (.asmref) next to this file pointing to the NGO's package. It'll make Unity consider this file as it was part of the NGO's package and effectively give it access to all NGO's
internal
methods.