Exemple #1
0
 private void OnDisable()
 {
     // When we disable, we just unregister our axis
     // It also happens before the game object is Destroyed
     JoystickInputManager.UnregisterVirtualAxis(HorizintalAxis);
     JoystickInputManager.UnregisterVirtualAxis(VerticalAxis);
 }
Exemple #2
0
        private void OnEnable()
        {
            // When we enable, we get our virtual axis

            HorizintalAxis = HorizintalAxis ?? new VirtualAxis(HorizontalAxisName);
            VerticalAxis   = VerticalAxis ?? new VirtualAxis(VerticalAxisName);

            // And register them in our input system
            JoystickInputManager.RegisterVirtualAxis(HorizintalAxis);
            JoystickInputManager.RegisterVirtualAxis(VerticalAxis);
        }