[]如何在laya中直接使用proto中定义的enum?
如何在laya中直接使用proto中定义的enum?
type.proto
enum e_server_msg_type {
e_mst_start_c2g = 300;
e_mst_c2g_heartbeat = 301; //心跳协议
e_mst_c2g_select_gate = 302; //选择网关
e_mst_start_g2c = 400;
e_mst_g2c_select_gate_result = 401;//选择网关返回
e_mst_g2c_send_msglist = 402;//发送协议列表
e_mst_cgend_index = 500;
}
type.proto
enum e_server_msg_type {
e_mst_start_c2g = 300;
e_mst_c2g_heartbeat = 301; //心跳协议
e_mst_c2g_select_gate = 302; //选择网关
e_mst_start_g2c = 400;
e_mst_g2c_select_gate_result = 401;//选择网关返回
e_mst_g2c_send_msglist = 402;//发送协议列表
e_mst_cgend_index = 500;
}
没有找到相关结果
已邀请:
要回复问题请先登录
3 个回复
cuixueying
赞同来自:
Zzz18815519
赞同来自:
let root_protocol:any = null;
function protobufInit(){
var ProtoBuf:any = Browser.window.protobuf;
ProtoBuf.load("type.proto", this.onProtoLoaded);
ProtoBuf.load("Lobby/protobuf/client2world_protocol.proto", this.onProtoBufLoaded1);
}
function onProtoLoaded(err:any, root:any):void{
if (err)
throw err;
root_protocol = root;
}
cuixueying
赞同来自: