LogicEditor | Refactor SimpleAudio to accept input in Editor
Summary
The current SimpleAudio
node can only play assets already setup in inspector in the scene. For each additional sound, a separate audiosource is thus needed.
Problem or need
A refactor is proposed which would allow users to slot in audio clips in the LogicEditor, thus allowing for a single audiosource to be able to play different sounds as needed.
The use case motivating this is a simple global audio source for instructions. As these do not rely on spatialization, having the scene spammed with multiple audiosources seemed counterproductive.
Proposed solution
Refactor the SimpleAudio
node to work like the SimpleText
node, in that it can accept audioclips directly in editor.
Alternatives considered
Creating a library of all sounds needed in a scene (which then could be serialized for runtime use) would be another approach. But we have not yet decided on how to handle more complex files like audio and video when transitioning to a runtime LogicEditor, thus this is a fairly easy to implement temporary solution.
Additional context
N/A