예제 #1
0
 public static Offset <PlayerInitInfoS> CreatePlayerInitInfoS(FlatBufferBuilder builder,
                                                              StringOffset nameOffset = default(StringOffset),
                                                              int number             = 0,
                                                              int hero               = 0,
                                                              int color              = 0,
                                                              int playerType         = 0,
                                                              int photonPlayerNumber = 0,
                                                              bool isReady           = false)
 {
     builder.StartTable(7);
     PlayerInitInfoS.AddPhotonPlayerNumber(builder, photonPlayerNumber);
     PlayerInitInfoS.AddPlayerType(builder, playerType);
     PlayerInitInfoS.AddColor(builder, color);
     PlayerInitInfoS.AddHero(builder, hero);
     PlayerInitInfoS.AddNumber(builder, number);
     PlayerInitInfoS.AddName(builder, nameOffset);
     PlayerInitInfoS.AddIsReady(builder, isReady);
     return(PlayerInitInfoS.EndPlayerInitInfoS(builder));
 }
예제 #2
0
    internal byte[] Serizalize()
    {
        FlatBufferBuilder fbb     = new FlatBufferBuilder(1);
        StringOffset      nameOff = fbb.CreateString(Name);

        PlayerInitInfoS.StartPlayerInitInfoS(fbb);
        PlayerInitInfoS.AddName(fbb, nameOff);
        PlayerInitInfoS.AddNumber(fbb, Number);
        PlayerInitInfoS.AddHero(fbb, (int)Hero);
        PlayerInitInfoS.AddColor(fbb, (int)Color);
        PlayerInitInfoS.AddPlayerType(fbb, (int)PlayerType);
        PlayerInitInfoS.AddIsReady(fbb, IsReady);
        PlayerInitInfoS.AddPhotonPlayerNumber(fbb, PhotonPlayer.ActorNumber);
        Offset <PlayerInitInfoS> playerInfoOffset = PlayerInitInfoS.EndPlayerInitInfoS(fbb);

        fbb.Finish(playerInfoOffset.Value);
        byte[] result = fbb.SizedByteArray();
        return(result);
    }