Add a config property to not log undefined Unity Event Listeners #544
forforfos
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
TL;DR:
Suggestion to add a config property that allows users to disable the console warning
Unable to find Event Listener in Event System for Event
. This is so we can hide those warnings in production mode.Probably something like the following:
In Detail
The way the
event-system
works, is that whenever an Event is triggered from Unity, but the corresponding EventListener is not found, a console warning is triggered. However, there are a few cases where this is intended:Regarding the first one, I am willing to investigate, if it's possible to separate Unity Event Arrays per instance, where each Unity Player runs only through its respective Event Listener list, but that's a different issue.
However, the case I want to deal with now has to do with events triggered multiple times, which if not encountered in the Event Listener Array, will trigger an enormous amount of console warnings, which can affect the performance as well.
Specifically, Unity allows for a Post Processing step, that we utilize in our project to render some textures from the Front End react part, using the Unity Canvas Webgl Context. This, being a conditional event listener (only runs when a modal is open) triggers the
Event listener not found
warning thousand of times in only a few seconds:I am willing to do a PR regarding this, if that's ok with you @jeffreylanters
Beta Was this translation helpful? Give feedback.
All reactions