第一步:

  1、安装node

    egret 添加 protobuf

  2、安装protobuf

    egret 添加 protobuf

 

第二步:

  1、创建egret项目。

    egret 添加 protobuf

  2、执行 pb-egret add 命令, protobuf 就会添加到 egret 项目中。

    egret 添加 protobuf

    egret 添加 protobuf

 

第三步:

  1、创建proto文件,自己手写一些消息格式(必写,不然生成会失败)。

    egret 添加 protobuf

    然后将该文件放入该目录 protobuf\protofile

      egret 添加 protobuf

 

第四步:

  1、执行命令 pb-egret generate

    egret 添加 protobuf

    命令执行后,就会生成如下文件:

      egret 添加 protobuf

 

最后:

  你就可以使用proto了。

  egret 添加 protobuf

  然后,编译引擎,启动项目:

    egret 添加 protobuf

    60秒。。。

相关文章:

  • 2022-12-23
  • 2021-09-12
  • 2022-12-23
  • 2018-02-21
  • 2021-07-18
  • 2022-12-23
  • 2021-07-06
猜你喜欢
  • 2021-04-04
  • 2022-12-23
  • 2021-12-17
  • 2022-12-23
  • 2022-12-23
  • 2022-01-28
  • 2022-12-23
相关资源
相似解决方案