r1sc / Open76

Interstate '76 engine reimplementation
GNU General Public License v3.0
52 stars 3 forks source link

Radio Manager & Small Misc Fixes #11

Closed JJJohan closed 5 years ago

JJJohan commented 5 years ago
r1sc commented 5 years ago

I checked it out, looks good! I want to merge this. However I had to make one small modification. I see you added an Instance property to the CacheManager which sets itself on Start(). This won't work on my machine (tm), the CacheManager Start() is not executed until later, so the RoadManager tries to invoke something on CacheManager.Instance which is null. This causes a race condition, maybe this works better for you but not here.

I removed the Instance property and went back to the way it was, just querying for the CacheManger in the RoadManager with GameObject.FIndObjectOfType which works fine.

Can you make this modification and submit the pull request again? I could do it but then I can't use the shiny green "Merge" button above :)

JJJohan commented 5 years ago

No problem.

Also wanted to say the radio playback seems to work very well for me. So far it's respecting the order, and there's no clicking issues as mentioned for the other sound effects (although I suspect I messed something up there) and they actually drop right in - when I set the player's health to 0 the mission state machine, out of the box, handled playing the death scream which was a pleasant surprise.