Quantcast
Channel: Cocos中文社区 - 最新主题
Viewing all articles
Browse latest Browse all 88857

CocosCreater typescript Protobuf 属性只能用 一部分 属性 array的

$
0
0

@852388396 写道:

syntax = "proto2"
message PlayerInfo {
required string userId = 1;
required string name = 2;
required string avatarUrl = 3;
required int32 leftScore = 4;
required int32 status = 5;
required int32 roundStatus = 6;
required int32 sit = 7;
repeated int32 first = 8;
repeated int32 second = 9;
repeated int32 third = 10;
repeated int32 handsCards = 11;

optional int64 userCode = 13; //用户的code
optional int32 vipLevel = 14; //vip等级
optional string ip = 15;
optional float longitude = 16; //经度
optional float latitude = 17; // 纬度
optional bool giveUp = 18;

}
nodejs 安装好后 按照 Protobuf 6.8.X 以上,
用这两个命令 生成
pbjs -t static-module -w commonjs -o bundle.js *.proto
pbts -o bundle.d.ts bundle.js
只有部分属性能用

帖子: 2

参与者: 1

阅读整个主题


Viewing all articles
Browse latest Browse all 88857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>