private static void PushField(this ILuaState self, IMessage nm, PB_Field field) { switch (field.type) { case PB_Type.Int32: self.SetKeyValue(field.name, nm.readU32()); break; case PB_Type.Int64: self.SetKeyValue(field.name, nm.readU64()); break; case PB_Type.Float: self.SetKeyValue(field.name, nm.readFloat()); break; case PB_Type.String: self.SetKeyValue(field.name, nm.readString()); break; } }