mixer / interactive-unity-plugin

Unity Plugin for Mixer Interactivity
MIT License
59 stars 23 forks source link

Provide extensibility by allowing outside code to get message ID from same sequence #129

Closed jorisdg closed 4 years ago

jorisdg commented 5 years ago

\Assets\MixerInteractive\Source\Scripts\InteractivityManager.cs

I've added a method to get a new message ID. This allows me to implement some other protocol methods, and hooking into the interactivity message sequence to avoid number clashes which of course is needed to handle replies correctly.

    public uint GetNewMessageID()
    {
        return _currentmessageID++;
    }

And then I replaced all occurrences of _currentmessageID++ with this method call for consistency.

Now I can implement my own protocol methods, but ensure I have unique message IDs by calling this public method. Very willing to send a pull request if this of interest.