-
Notifications
You must be signed in to change notification settings - Fork 63
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
Mechanical sound support part 3 #495
base: master
Are you sure you want to change the base?
Conversation
…component. Have mechsoundcomponent inherit from monobehaviour directly. Update mechsoundinspector to inherit from unity editor directly and by adding a propertydrawer to handle mechsound appearance. Initialize soundlist in mechsoundscomponent.
…he MechSound Drawer. Handle when no component attached to the gameobject implements it.
…om methods, refactor handling of audio clip playing using an established gameobject's audiosource, and moved call to update event into OnEnable method. Also deleted mechsounddata and some other minor cleanup.
…changes and then playing the clips under round robin selection.
…ts: plunger, drain, bumper.
convenient especially prefabs.
Awesome! This will take a little bit of time to review, trying my best for this week. |
Committed a fix for the zero-volume-by-default problem when adding |
93fc9f3
to
0187995
Compare
I have read through the guide @Mr-Jay-Gatsby followed to implement sound fading, so I understand why he chose not to simply fade the volume on the AudioSource directly and opted to fade the volume of audio mixer groups trough an exposed parameter instead. (Smooth interpolation in case of low frame rate) What I don't get is how this is supposed to allow fading audio sources individually. Is there supposed to be an audio mixer group for every single audio source? That is not at all what they are meant for and will quickly get out of hand. Also, there seems to be no API to create mixer groups and expose the volume automatically, so for every
If this is the only alternative, I think we should just use |
Picking up where linojon left off in #466. I merged his changes into my fork and rebased the feature branch onto the upstream master branch. Here are the problems I have identified so far:
Problems
Usability
Add mech sound button situation ✅
Audio playback in editor ✅
SoundAssets
have a button to play back their audio in the editor. Pressing this button creates a new game object with an audio source in the currently open scene, if such an object doesn't already exist. This behavior is an unexpected and unwelcome side-effect, because it permanently alters the currently open scene.Sounds must be added manually
Users must manually add sounds to each game object (these should be included in prefabs instead).
Architecture
Inheritance for the sake of type constraints ✅
DropTargetBankApi
needed a reference to the associatedDropTargetBankComponent
to call itsEmitSound
method. In otherxApi
classes the associatedxComponent
instance is referenced using theMainComponent
property defined in the abstract base classItemApi
.DropTargetBankApi
previously did not inherit fromItemApi
becauseItemApi
has a type parameter for the component type and a constraint that requires that type parameter (in this caseDropTargetBankComponent
) to inherit from the abstract base classMainComponent
, whichDropTargetBankComponent
did not. linojon solved this by makingDropTargetBankComponent
inherit fromMainComponent
purely to satisfy the constraint ofItemApi
without actually implementing any of the abstract methods ofMainComponent
(and instead throwing an Exception when they are called). This is bad because it leads to unexpected results when calling those methodsDiligence
SerializableDictionary
withNonSerialized
attribute inMechSoundsComponent
seems a bit pointless, but I have not yet checked whether it actually isSerialized
andNonSerialized
attributespublic
fields all overBugs
MechSound.volume
is not appliedIncomplete