add no-op delegate to gamepad connect events
parent
6c93350f7f
commit
36a88afe52
|
@ -41,7 +41,7 @@ namespace MoonWorks.Input
|
|||
/// Called when a gamepad has been connected.
|
||||
/// </summary>
|
||||
/// <param name="slot">The slot where the connection occurred.</param>
|
||||
public OnGamepadConnectedFunc OnGamepadConnected;
|
||||
public OnGamepadConnectedFunc OnGamepadConnected = delegate { };
|
||||
|
||||
public delegate void OnGamepadDisconnectedFunc(int slot);
|
||||
|
||||
|
@ -49,7 +49,7 @@ namespace MoonWorks.Input
|
|||
/// Called when a gamepad has been disconnected.
|
||||
/// </summary>
|
||||
/// <param name="slot">The slot where the disconnection occurred.</param>
|
||||
public OnGamepadDisconnectedFunc OnGamepadDisconnected;
|
||||
public OnGamepadDisconnectedFunc OnGamepadDisconnected = delegate { };
|
||||
|
||||
internal Inputs()
|
||||
{
|
||||
|
@ -142,8 +142,12 @@ namespace MoonWorks.Input
|
|||
{
|
||||
Gamepads[slot].Register(openResult);
|
||||
Logger.LogInfo($"Gamepad added to slot {slot}!");
|
||||
|
||||
if (OnGamepadConnected != null)
|
||||
{
|
||||
OnGamepadConnected(slot);
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue