- Home /
Allow CrossPlatformInputManager to use a Custom VirtualInput extended Class [Unity5]
This question refers to the new Standard Assets included with Unity 5.
I'm creating a unity package for a custom controller.
I've created a custom Input class which extends the VirtualInput class. It's much the same as the StandaloneInput class, however I'm using different methods for returning the Axis and MousePosition values, this to allow for the custom controller which also includes a directional tracker. My new class is called CustomStandAloneInput.cs
My problem is that I need to set the active input method in CrossPlatformInputManager.cs to be my new custom VirtualInput class (CustomStandAloneInput). This is the constructor of CrossPlatformInputManager
static CrossPlatformInputManager()
{
s_TouchInput = new MobileInput();
s_HardwareInput = new StandaloneInput();
#if MOBILE_INPUT
activeInput = s_TouchInput;
#else
activeInput = s_HardwareInput;
#endif
}
StandAloneInput extends VirtualInput.
Is there a way I can assign s_HardwareInput to be my new CustomStandAloneInput class without altering the CrossPlatformInputManager code?
Thanks
Harvey