private void OnEnable() { // When we enable, we get our virtual axes HorizontalAxis = HorizontalAxis ?? new VirtualAxis(HorizontalAxisName); VerticalAxis = VerticalAxis ?? new VirtualAxis(VerticalAxisName); JoystickDepressedAxis = JoystickDepressedAxis ?? new VirtualAxis(JoystickDepressedAxisName); // And register them in our input system CnInputManager.RegisterVirtualAxis(HorizontalAxis); CnInputManager.RegisterVirtualAxis(VerticalAxis); CnInputManager.RegisterVirtualAxis(JoystickDepressedAxis); }