Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d55217c

Browse files
committed
better support for local co-op. you can now run up to 4 input configurations at the same time
1 parent ae4ed13 commit d55217c

36 files changed

Lines changed: 2677 additions & 308 deletions

Assets/InputManager/Addons/InputAdapter/Resources/input_adapter_default_config.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
2-
<Input defaultConfiguration="KeyboardAndMouse">
1+
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
2+
<Input playerOneDefault="KeyboardAndMouse" playerTwoDefault="" playerThreeDefault="" playerFourDefault="">
33
<InputConfiguration name="KeyboardAndMouse">
44
<AxisConfiguration name="Horizontal">
55
<description />
@@ -728,4 +728,4 @@
728728
<joystick>0</joystick>
729729
</AxisConfiguration>
730730
</InputConfiguration>
731-
</Input>
731+
</Input>

Assets/InputManager/Addons/InputAdapter/Runtime/InputAdapter.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,8 @@ public static bool GetTriggerButtonUp(InputTriggerButton button)
413413

414414
public static void ResetInputAxes()
415415
{
416-
InputManager.ResetInputAxes();
416+
InputManager.ResetInputConfiguration(PlayerID.One);
417+
InputManager.ResetInputAxes();
417418
}
418419

419420
public static string[] GetJoystickNames()
@@ -583,7 +584,7 @@ private void SetInputDevice(InputDevice inpuDevice)
583584
#else
584585
Screen.showCursor = false;
585586
#endif
586-
InputManager.SetInputConfiguration(_joystickConfiguration);
587+
InputManager.SetInputConfiguration(_joystickConfiguration, PlayerID.One);
587588
Debug.Log("Current Input Device: Joystick");
588589
}
589590
else
@@ -593,10 +594,10 @@ private void SetInputDevice(InputDevice inpuDevice)
593594
#else
594595
Screen.showCursor = true;
595596
#endif
596-
InputManager.SetInputConfiguration(_keyboardConfiguration);
597+
InputManager.SetInputConfiguration(_keyboardConfiguration, PlayerID.One);
597598
Debug.Log("Current Input Device: KeyboardAndMouse");
598599
}
599-
InputManager.ResetInputAxes();
600+
ResetInputAxes();
600601
RaiseInputDeviceChangedEvent();
601602
}
602603

@@ -654,4 +655,4 @@ private static void Create()
654655
}
655656
#endif
656657
}
657-
}
658+
}

Assets/InputManager/Examples/01 - Controls Menu/Data/default_input.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
2-
<Input defaultConfiguration="KeyboardAndMouse">
1+
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
2+
<Input playerOneDefault="KeyboardAndMouse" playerTwoDefault="" playerThreeDefault="" playerFourDefault="">
33
<InputConfiguration name="KeyboardAndMouse">
44
<AxisConfiguration name="Horizontal">
55
<description />
@@ -334,4 +334,4 @@
334334
<joystick>0</joystick>
335335
</AxisConfiguration>
336336
</InputConfiguration>
337-
</Input>
337+
</Input>

0 commit comments

Comments
 (0)