colyseus / colyseus-unity-sdk

⚔ Colyseus Multiplayer SDK for Unity
https://docs.colyseus.io/getting-started/unity-sdk/
MIT License
371 stars 100 forks source link

Several callbacks can be added to a same message type and disposed (#197) #199

Open sticmac opened 2 years ago

sticmac commented 2 years ago

Related to #197.

This PR provides a solution which allows one to assign several callbacks to a same message type. Each OnMessage call returns an IDisposable object which can later be called through the Dispose method to remove the callback.

lpsandaruwan commented 2 years ago

Hi @endel,

I tested this, materials are in https://github.com/lpsandaruwan/colyseus-unity-sdk-test-pr-199 Looking good 👍 💯