Hi - I’m writing my own input module base off the StandaloneInputModule.cs code (so I can bypass the Input system on PS4 and still drive the Unity.UI system). The problem I’m having is that I need to hook into the construction and destruction of this object and it’s doing some crazy stuff.
For instance, when I load the scene with the component in the constructor is called - even without running the scene. In fact from loading the scene to hitting play and getting in to my game the constructor is called three times. I don’t know why. There’s only one instance in the scene.
So I thought I’d put some ‘Application.isRunning’ checks around my custom setup code, just to rule out any Editor crazyness, and now the code fails telling me I can only call ‘Application’ from the main thread. So for whatever reason my input module is being called from a non-main thread too.
Can anyone explain what’s going on here ? Or have a good suggestion for how I can hook into the creation and destruction (in game) of my input module ? Any documentation or blog entries anywhere that could help me figure this out ?
Thanks.