Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Hey!

This is something I've thought of before, and actually... I think there's enough in STM for this to be built *on top* instead of changing the code, but changing the code is fine! I publish updates semi-frequently with bugfixes, but unless a change effects you (either fixes a bug or adds a feature you want) you don't *need* to update... and if you do, I think you could use source control to merge your local changes with mine!

Either way, here's three ways to do it:


Inside of SuperTextMesh.cs, there's a PlaySound() method that's invoked every time it's supposed to play a sound. You could just edit this function to do what you need it to do! Or for a fancier approach...


You could make this a virtual method (I'd change it to be virtual myself in the next update if you go with this), and you could make a "MasterAudioSuperTextMesh" class that inherits from SuperTextMesh, but with an overridden PlaySound() function. You can even extend the custom editor to add the additional components you need with the code here: http://answers.unity.com/answers/208172/view.html I think DrawDefaultInspector could be used to get the new components, or you could use reflection? I know I've used code like that before, I just can't find the right forum post.


Method #3 is to use STM's "OnPrintEvent"! This UnityEvent/delegate event is invoked every time a character is printed, and using it together with hyphenedText[latestNumber] you could even do events for specific letters. If you do it this way, you could just have an additional monobehaviour that sits on your STM object and handles audio stuff! This is probably the easiest way to do it and doesn't involve touching the source code at all.


Anyway, I hope this helps! I think method #3 might be the place to start, using delegate events to handle this would be great!