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

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

只有部分属性能用

而且 其他Proto

弄好了 只能降低 Protobufjs 版本

6.8的话我这用的,一直没问题·············
不过我是
syntax = “proto3”

我是 proto2 只能这样,最新的Protobufjs 对proto2 不行 他只能用 Proto3 估计