Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Unity] Allow Steam Audio to load but not run on unsupported platform or when STEAMAUDIO_ENABLED define symbol is not present. #280

Merged
merged 1 commit into from
Oct 26, 2023

Conversation

TsFreddie
Copy link
Contributor

@TsFreddie TsFreddie commented Oct 20, 2023

in 4.4.1, STEAMAUDIO_ENABLED was added to indicate Steam Audio is present in the project and it is on a supported platform.

However, in a lot of cases, most Steam Audio components will still present in the scenes and prefabs, which would create a lot of broken prefabs and missing scripts for existing project to port onto a unsupported platform.

By wrapping all Steam Audio code in STEAMAUDIO_ENABLED besides serialized fields in components, we can stop Steam Audio from ever running while keeping all the prefab and serialized data intact when switching platforms without losing components or data.

As a bonus, this also prevents Steam Audio from running in Dedicated Server build since it is not a "supported platform" with STEAMAUDIO_ENABLED symbol enabled even though the binary can be bundled.

This however does not mean a fallback to unity audio or fmod, it is still up to the developer to make sure they config and play the audio accordingly (and maybe strip unused SteamAudio data when building). But it would be much easier to get started without having to manually remove all existing Steam Audio components just to make the errors go away.

The C# targeted platform is also restored to all platforms since the code can dry run and it is designed to keep the components.

@TsFreddie TsFreddie changed the title Allow Steam Audio to load but not run on unsupported platform or when STEAMAUDIO_ENABLED define symbol is not present. [Unity] Allow Steam Audio to load but not run on unsupported platform or when STEAMAUDIO_ENABLED define symbol is not present. Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants