This page will help you understand how to use Grpc for unity step by step and all the script in inside the HelloWorld demoscene.

But Before Start:
Define your .proto file. For example:
syntax = "proto3";
package helloworld;
service Greeter{
rpc SayHello(HelloRequest) returns (HelloReply){}
}
message HelloRequest{
string name =1;
}
message HelloReply{
string message=1;
}
For more information about protobuf, please check official website https://developers.google.com/protocol-buffers/docs/csharptutorial.
Place your .proto file inside Unity folder, and use our built-in tool to compile protobuf class. For more info about protobuf compilation tool, please check here.
It should contains the .proto file, and 2 generated c# class. Note We already pre-compile the example helloworld.proto class for you.

Create a new c# class and inherient GrpcServerBase.

You need to bind the proto service with your custom class, for example:

Create a new c# class and inherient GrpcClientBase.

SendGrpc() is the function that need to implement, which send the Rpc info to the server.
SayHello() - The function name you define in .proto file.
TRequest - The generic request you define in .protoc file which is the Hello Request.