Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to build a protobuf. proto #2

Open
kane9527-e opened this issue Aug 5, 2023 · 2 comments
Open

How to build a protobuf. proto #2

kane9527-e opened this issue Aug 5, 2023 · 2 comments
Labels
question Further information is requested

Comments

@kane9527-e
Copy link

kane9527-e commented Aug 5, 2023

Thank you for opening up! How to build a protobuf. proto file as cs? Can't you use Grpc.Tools in Unity anymore? So Can you provide a complete example project for generating and calling the GRPC protocol?

@MonoLogueChi
Copy link

MonoLogueChi commented Aug 5, 2023

I have a solution using the package protobuf-unity, It is also very simple to use.

  1. Download Grpc.Tools and change it to zip, unzip it, and use it later.
  2. Download Google.Protobuf and change to zip, unzip, extract the .dll file and put it under Plugins, just like other plugins.
  3. Install the plugin protobuf-unity, as in the documentation
  4. Set the plug-in according to the document, and fill in the binary file decompressed in the first step for the protoc and grpc paths.
  5. If the previous configuration is correct, drag a .proto file into unity, and it will automatically compile and generate two .cs files.

write a demo

@pspgit
Copy link

pspgit commented Aug 5, 2023

If you create both client and server, I'd recommend MagicOnion (https://github.com/Cysharp/MagicOnion) instead of plain gRPC.
It is build over gRPC, optimized for Unity and does not require .proto files - you write your protos as C# code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants