-3. Your generated class will then contains `using Google.Protobuf` usage, so additionally you have to add `Google.Protobuf.dll` precompiled library in your Unity project or link to your `asmdef`. This plugin itself doesn't need it, and I didn't bundle the `dll` along with this. You can go to [the repo](https://github.com/protocolbuffers/protobuf) and compile manually or download the Nuget package here https://www.nuget.org/packages/Google.Protobuf then use archive extract tools to get the .dll out. It contains targets such as .NET 4.6 and .NET Standard 1.0/2.0. Then it will ask for `System.Memory.dll` because it want to use `Span` class but Unity is not supporting it yet. By also [downloading it](https://www.nuget.org/packages/System.Memory/), it will then ask for missing references `System.Runtime.CompilerServices.Unsafe` and `System.Buffers`. To prevent you having to fetch missing `dll` over and over in chains, you can uncheck "Validate References" on the `System.Memory.dll`. Usually skipping the validation is bad, as if Protobuf ended up using the area of code in `System.Memory.dll` that needs them and could not dynamically link, then it probably crash. But so far seems like it is not the case.
0 commit comments