6
4

More than 5 years have passed since last update.

UnityでgRPCを動かす #1 コンソールアプリ

Last updated at Posted at 2018-02-04

ゴール:Unity(iOS/Android)でgRPCを動かす

開発環境:macOS Sierra + Unity 2017.3.0f3
開発環境:macOS Mojave + Unity 2019.1.5f1
今回はその1です。

コンソールアプリでgRPCのサンプルを動かす

C#で開発するのでVisual Studio for Mac(以下vs)をインストールします。

次にgRPCの本体+サンプルをcloneします。

$ cd (個人の作業用フォルダ)
$ git clone https://github.com/grpc/grpc.git

サンプルのソリューションファイルを開きます。cloneを実行したフォルダに入り、次のコマンドを実行します。するとvsが起動します。

$ open examples/csharp/helloworld/Greeter.sln

image.png

GreeterServerプロジェクトを右クリックして「プロジェクトの実行」を選択します。するとC#で書かれたサーバー側のプログラムが起動します。

image.png

GreeterClientプロジェクトを右クリックして「プロジェクトの実行」を選択します。C#で書かれたクライアントのプログラムが実行されて、サーバーのメソッドを呼び出します。

image.png

次回予告

ここまで、C#のコンソールアプリとしてサンプルを動かしてきました。次はクライアントをUnityで作成してみます。

6
4
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
4