Unity中使用gRPC

時間20180508,使用的unity版本2017.2,unity中的.net 4.6平臺仍是不穩定版本。git

示例代碼地址:https://github.com/hiramtan/HigRPC_unitygithub

估計還不會有人用在商業手遊項目中,緣由:windows

  • .net 4.6仍是實驗性版本,並不能保證穩定性。
  • 編譯可用的gRPC類庫到移動平臺。
  • 須要驗證在Android iOS平臺上全部邏輯的穩定性。

在編輯器中使用流程以下:編輯器

How to use in unity

  • 設置 .net 4.6 測試

  • 導入 gRPC dll.net

    • Google.Protobuf.dll
    • Grpc.Core.dll
    • grpc_csharp_ext.x64.dll
    • System.Interactive.Async.dll
  • 建立測試邏輯.code

Extention

用戶自定義協議及代碼生成orm

Grpc.Tools.1.11.x\tools\windows_x86\protoc.exe -I../../protos --csharp_out Greeter --grpc_out Greeter ../../protos/helloworld.proto --plugin=protoc-gen-grpc=packages/Grpc.Tools.1.11.x/tools/windows_x86/grpc_csharp_plugin.exe

Note: Haven't test on mobile platformblog

點擊連接加入QQ羣【83596104】:https://jq.qq.com/?_wv=1027&k=5l6rZErrpc

相關文章
相關標籤/搜索