private void ProcessShapeAdded(BasePacketHeader packet) { ShapeCreatedMessage shapeCreatedPacket = ShapeCreatedMessage.Parser.ParseFrom(packet.PacketBytes, packet.startOfPacketData, packet.messageHeader.DataSize); switch (shapeCreatedPacket.ShapeType) { case ShapeTypePacket.Obb: { ObbShapePacket createdObbPacket = ObbShapePacket.Parser.ParseFrom(packet.PacketBytes, packet.startOfPacketData + shapeCreatedPacket.CalculateSize(), shapeCreatedPacket.ShapeSize); ObbShape createdObb = new ObbShape(); createdObb.ImportFromPacket(createdObbPacket); RegisterNewlyReceivedShape(packet, createdObb); } break; case ShapeTypePacket.Sphere: break; case ShapeTypePacket.Cone: break; case ShapeTypePacket.ConvexHull: { ConvexHullShapePacket createdConvexHullPacket = ConvexHullShapePacket.Parser.ParseFrom(packet.PacketBytes, packet.startOfPacketData + shapeCreatedPacket.CalculateSize(), shapeCreatedPacket.ShapeSize); ConvexHullShape createdConvexHull = new ConvexHullShape(); createdConvexHull.ImportFromPacket(createdConvexHullPacket); RegisterNewlyReceivedShape(packet, createdConvexHull); } break; case ShapeTypePacket.Tetrahedron: { TetrahedronShapePacket createdTetrahedronPacket = TetrahedronShapePacket.Parser.ParseFrom(packet.PacketBytes, packet.startOfPacketData + shapeCreatedPacket.CalculateSize(), shapeCreatedPacket.ShapeSize); TetrahedronShape createdTetrahedron = new TetrahedronShape(); createdTetrahedron.ImportFromPacket(createdTetrahedronPacket); RegisterNewlyReceivedShape(packet, createdTetrahedron); } break; default: break; } }