Studio-Lovelies / GG-JointJustice-Unity

It's the repo for the GGJJ Unity version! I'm too dumb to come up with a wittier description.
Mozilla Public License 2.0
7 stars 8 forks source link

Handle looping music #390

Open ViMaSter opened 1 year ago

ViMaSter commented 1 year ago

Description

Music can optionally have loop sections defined. Currently, these files are simply looped from beginning to end.

Acceptance Criteria

This story will be finished when Unity handles two types of .ogg and .wav files:

ViMaSter commented 1 year ago

Potential implementation:

ViMaSter commented 12 months ago

So...

I tried to extract the data as late as possible:


The "simplest" but most labor-intensive way is adding a MenuItem (like Assets -> Export and store loop markers) to the editor, which you need to run manually, in the editor, on each music file. I feel there's a lot of room for oversight and I'm not a fan:


There's one potential implementation which works around 1: StreamingAssets
This would allow raw access to the original files. Meaning, there's no need to do anything special in the editor. However:

You can only have one StreamingAssets folder, and it must be placed in the root of the Project, directly within the Assets folder.

We'd have to relocate all music files to that specific directory (or a subdirectory thereof, Assets/StreamingAssets/Music/CoolPatrolX.ogg) for this to work, however, it would offer all advantages:

Opinions on this implementation or alternatives, that offer the same set of advantages?

lyndsiWilliams commented 12 months ago

I don't see any downfalls to using StreamingAssets based on what you've presented. It's always good to go for the route with fewer possibilities for "user error", as you've explained. Having all the music in one place sounds like a good idea too. I say go for it, nice solution!