void OnReceive(byte[] bytes) { //Debug.Log("receive bytes: " + BitConverter.ToInt32(bytes, 0)); var byteArray = new ByteArray(); byteArray.Write(bytes); MsgRegister.Dispatch("10001", byteArray); }
void Main() { MsgRegister.Regist("PlayDie", OnPlayerDie); //when get bytes from socket(OnReceive) { string name = "PlayerDie"; IByteArray byteArray = new ByteArray(); byteArray.Write(new byte[10]); MsgRegister.Dispatch(name, byteArray); } }