0

Is there a recommended way to kill the Global Message Listener?

RobD 2 years ago 0

Hi there,

I'm on a mission to eliminate garbage generation in our game (it's VR, so GC is a really bad thing for us). I've got to the point where there's only one source of garbage left, and it's the Global Message Listener. 

Turns out that if any component has an OnGUI function, it causes Unity's IMGUI process to run every frame which generates a few hundred bytes of garbage. Global Message Listener has an OnGUI function, and so generates garbage.

We're not hooking in any of the messages that Message Listener supplies, so it's safe for us to get rid of it. My current plan is just to write some code that finds it and sets it as inactive. I was just wondering though - is there an "official" way to prevent it being created in the first place?

Thanks,

Rob.

Bolt Version:
1.4.8f2
Unity Version:
2018.4.14f1
Platform(s):
All
Scripting Backend:
IL2CPP
.NET Version (API Compatibility Level):
.NET 4.x