dwilches / Ardity

Assets for integrating Arduino and Unity (or Unity and any hardware that communicates over a COM port)
329 stars 62 forks source link

Add functionality to read all messages in queue #75

Closed Xaverix closed 5 months ago

Xaverix commented 5 months ago

Hello! Lately I was using the plugin and had a need to read all the messages in the queue every frame. The game was running at about 60FPS and I was getting 100 messages per second.

With smaller buffer size I was dropping messages (which was not acceptable for this specific use case), with bigger buffer size it introduced delay and still dropped messages.

Currently reading all messages is only possible without Message Listener (by reading messages until they're null). This PR adds functionality to read all messages to the Message Listener.

dwilches commented 5 months ago

Hello @Xaverix Thanks a lot for taking the time to improve Ardity! I've reviewed and merged your pull request. Have a good day!