Skip to content

Commit b375e53

Browse files
committed
feat(state): add ifdefs to determine whether input manager is enabled
The relevant input manager code is now wrapped in ifdefs to only run if the Unity Input Manager is enabled and therefore will provide a warning if the code is run when it is not enabled.
1 parent 0eaf38a commit b375e53

3 files changed

Lines changed: 12 additions & 0 deletions

File tree

Runtime/SharedResources/Scripts/UnityInputManagerAxis1DAction.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ public float Multiplier
4747
/// <inheritdoc />
4848
public void Process()
4949
{
50+
#if ENABLE_LEGACY_INPUT_MANAGER
5051
Receive(Input.GetAxis(AxisName) * Multiplier);
52+
#else
53+
Debug.LogWarning("The Legacy Unity Input Manager is disabled in the player settings.");
54+
#endif
5155
}
5256
}
5357
}

Runtime/SharedResources/Scripts/UnityInputManagerAxis2DAction.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,11 @@ public float YMultiplier
8181
/// <inheritdoc />
8282
public void Process()
8383
{
84+
#if ENABLE_LEGACY_INPUT_MANAGER
8485
Receive(new Vector2(Input.GetAxis(XAxisName) * XMultiplier, Input.GetAxis(YAxisName) * YMultiplier));
86+
#else
87+
Debug.LogWarning("The Legacy Unity Input Manager is disabled in the player settings.");
88+
#endif
8589
}
8690
}
8791
}

Runtime/SharedResources/Scripts/UnityInputManagerButtonAction.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ public KeyCode KeyCode
3030
/// <inheritdoc />
3131
public void Process()
3232
{
33+
#if ENABLE_LEGACY_INPUT_MANAGER
3334
Receive(Input.GetKey(KeyCode));
35+
#else
36+
Debug.LogWarning("The Legacy Unity Input Manager is disabled in the player settings.");
37+
#endif
3438
}
3539
}
3640
}

0 commit comments

Comments
 (0)