示例#1
0
 public void MergeFrom(RigidBodyPacket other)
 {
     if (other == null)
     {
         return;
     }
     if (other.Id != 0)
     {
         Id = other.Id;
     }
     if (other.position_ != null)
     {
         if (position_ == null)
         {
             Position = new global::Physics.Telemetry.Serialised.Matrix4x4Packet();
         }
         Position.MergeFrom(other.Position);
     }
     if (other.velocity_ != null)
     {
         if (velocity_ == null)
         {
             Velocity = new global::Physics.Telemetry.Serialised.Vector4Packet();
         }
         Velocity.MergeFrom(other.Velocity);
     }
     collisionShapes_.Add(other.collisionShapes_);
     _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
 }
示例#2
0
        public void MergeFrom(pb::CodedInputStream input)
        {
            uint tag;

            while ((tag = input.ReadTag()) != 0)
            {
                switch (tag)
                {
                default:
                    _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
                    break;

                case 8: {
                    Id = input.ReadUInt32();
                    break;
                }

                case 18: {
                    if (position_ == null)
                    {
                        Position = new global::Physics.Telemetry.Serialised.Matrix4x4Packet();
                    }
                    input.ReadMessage(Position);
                    break;
                }

                case 26: {
                    if (velocity_ == null)
                    {
                        Velocity = new global::Physics.Telemetry.Serialised.Vector4Packet();
                    }
                    input.ReadMessage(Velocity);
                    break;
                }

                case 34:
                case 32: {
                    collisionShapes_.AddEntriesFrom(input, _repeated_collisionShapes_codec);
                    break;
                }
                }
            }
        }