Skip to content

Conversation

brechtos
Copy link

@brechtos brechtos commented Nov 7, 2018

Added a some safety code to ensure emitters are nicely cleaned up on destroy.
Added the ability to SetParameter by index instead of string

Fixed issues with the AttachInstanceToGameObject methods.
This mainly fixes issues when being called via the PlayOneShotAttached method.
AttachInstanceToGameObject  now directly sets the 3dAttribute while attaching to ensure an initial correct and valid 3d positioning is applied.
Before a 3d position would only by applied to the instance in the next update after the attach occured.
This can cause unexpected and unwanted results in case the target transform was destroyed between the attach and the update loop.

Example: A crate that plays a PlayOneShotAttached when it hits a surface but that also takes damage at the same time that can result in a destroy. The sound would play at the incorrect location as there was never an initial position set that matched the desired start position. This small change will fix this.
Updated the DrawDebugOverlay to no longer cause Garbage allocation as long as the overlay isn't enabled.
Before: OnGUI would always be called resulting in the Unity OnGUI to be active no matter what, generating unwanted overhead and garbage.
Now: As long as the debugoverlay isn't active no garbage will be allocated. A safety is also added to avoid the overhead being applied in a non editor build by accident. Can be adjusted if desired.
Added a some safety code to ensure emitters are nicely cleaned up on destroy.
Added the ability to SetParameter by index instead of string
@brechtos brechtos changed the title Event listener upgrades Event listener memory safety and usability upgrades Nov 7, 2018
@fmod-cameron
Copy link
Contributor

Thanks for the contribution, this has been added for release 1.10.13.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants