freezy / VisualPinball.Engine

:video_game: Visual Pinball Engine for Unity
https://docs.visualpinball.org
GNU General Public License v3.0
396 stars 62 forks source link

More mechanical sound support #466

Open linojon opened 7 months ago

linojon commented 7 months ago

Work on the feature/sounds branch, continuing @Mr-Jay-Gatsby's work. For discussion up to this point, see https://github.com/freezy/VisualPinball.Engine/pull/453

linojon commented 7 months ago

sorry 'bout all the commits, i like to do things in small increments when possible, and didnt squash the commits before creating the PR. Also the "Q to exit" isnt part of this feature, is a minor change for my convenience that i added to vpe-volley https://github.com/jsm174/vpe-volley/blob/sounds/Assets/Volley/Quitter.cs

freezy commented 7 months ago

I've had a quick look at the previous code. About objects that aren't rendered but emit sounds: How about creating a new SoundEmitterComponent that implements ISoundEmitter and where you're basically able to define the sound triggers by yourself. Each of those triggers would then result in a coil slot that is linkable through the visual scripting (or anything that can connect to a coil, really).

This way, you'd create a chimes GameObject positioned in the scene, add the SoundEmitterComponent, add a trigger for each chime, and add a MechSoundsComponent which will show the triggers for you to assign sounds to. Then, in visual scripting, hook the score reels to the coils that are exposed.

freezy commented 7 months ago

Oh, and also could you not commit the .mat files please? Those are unrelated to this PR and will result in conflicts later. And not remove the .meta files either, see https://github.com/freezy/VisualPinball.Engine/wiki/Development-Setup#meta-files

In general, never git commit -a, but choose the files that are relevant.

The number of commits doesn't matter, I prefer commits of small chunks too, but in this case I'd prefer if you'd squash or at least git rebase -i your commits to not have these changes in the history. Thanks!

linojon commented 7 months ago

ok, took a couple tries but i've rebased out the extraneous files.