Esempio n. 1
0
        public static Offset <Packet_Event_EvtHittingOther> Serialize(FlatBufferBuilder builder, EvtHittingOther obj)
        {
            StringOffset animEventIDOffset = new StringOffset();

            if (obj.animEventID != null)
            {
                animEventIDOffset = builder.CreateString(obj.animEventID);
            }
            Offset <MPAttackData> attackDataOffset = new Offset <MPAttackData>();

            if (obj.attackData != null)
            {
                attackDataOffset = Serialize(builder, obj.attackData);
            }
            Offset <MPHitCollision> hitCollisionOffset = new Offset <MPHitCollision>();

            if (obj.hitCollision != null)
            {
                hitCollisionOffset = Serialize(builder, obj.hitCollision);
            }
            Packet_Event_EvtHittingOther.StartPacket_Event_EvtHittingOther(builder);
            Packet_Event_EvtHittingOther.AddTargetID(builder, obj.targetID);
            Packet_Event_EvtHittingOther.AddToID(builder, obj.toID);
            Packet_Event_EvtHittingOther.AddAnimEventID(builder, animEventIDOffset);
            Packet_Event_EvtHittingOther.AddAttackData(builder, attackDataOffset);
            Packet_Event_EvtHittingOther.AddHitCollision(builder, hitCollisionOffset);
            return(Packet_Event_EvtHittingOther.EndPacket_Event_EvtHittingOther(builder));
        }
Esempio n. 2
0
 public static EvtHittingOther Deserialize(Packet_Event_EvtHittingOther table, EvtHittingOther obj)
 {
     if (obj == null)
     {
         obj = new EvtHittingOther();
     }
     obj.targetID    = table.TargetID;
     obj.toID        = table.ToID;
     obj.animEventID = table.AnimEventID;
     if (table.GetAttackData(GetCachedTable <MPAttackData>()) != null)
     {
         obj.attackData = Deserialize(GetCachedTable <MPAttackData>(), new AttackData());
     }
     if (table.GetHitCollision(GetCachedTable <MPHitCollision>()) != null)
     {
         obj.hitCollision = Deserialize(GetCachedTable <MPHitCollision>(), new AttackResult.HitCollsion());
     }
     return(obj);
 }