Skip to content

Commit 2650091

Browse files
committed
Change input preprocessor to only use one or the other
1 parent 8c5787b commit 2650091

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

Runtime/NavigationStack.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,23 @@ public class NavigationStack : MonoBehaviour
3232
public GameObject top => items.Count > 0 ? items.Peek() : null;
3333

3434
#if ENABLE_INPUT_SYSTEM
35+
3536
/// <summary>
3637
/// The input action that handles backwards navigation by popping items
3738
/// off the stack.
3839
/// </summary>
3940
[Tooltip("The input action that handles backwards navigation by popping items off the stack.")]
4041
public InputAction backNavigationInput = new InputAction("MenuBackNavigation", InputActionType.Button);
41-
#endif
4242

43-
#if ENABLE_LEGACY_INPUT_MANAGER
43+
#elif ENABLE_LEGACY_INPUT_MANAGER
44+
4445
/// <summary>
4546
/// The input button that handles backwards navigation by popping items
4647
/// off the stack.
4748
/// </summary>
4849
[Tooltip("The input button that handles backwards navigation by popping items off the stack.")]
4950
public string backNavigationInputButton = "Cancel";
51+
5052
#endif
5153

5254
/// <summary>

Runtime/ScrollToSelection.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,7 @@ private void CheckForManualScrolling()
9393
break;
9494
}
9595
}
96-
#endif
97-
98-
#if ENABLE_LEGACY_INPUT_MANAGER
96+
#elif ENABLE_LEGACY_INPUT_MANAGER
9997
switch (scrollDirection)
10098
{
10199
case ScrollDirection.Horizontal:

Runtime/ScrollWithInput.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,15 @@ public class ScrollWithInput : MonoBehaviour
2727
public ScrollDirection scrollDirection = ScrollDirection.Vertical;
2828

2929
#if ENABLE_INPUT_SYSTEM
30+
3031
/// <summary>
3132
/// The input action that handles scrolling.
3233
/// </summary>
3334
[Tooltip("The input action that handles scrolling.")]
3435
public InputAction scrollInput = new InputAction("ScrollInput", InputActionType.Value, null, null, null, "Vector2");
35-
#endif
3636

37-
#if ENABLE_LEGACY_INPUT_MANAGER
37+
#elif ENABLE_LEGACY_INPUT_MANAGER
38+
3839
/// <summary>
3940
/// The input axis that handles scrolling in the y-axis.
4041
/// </summary>
@@ -46,6 +47,7 @@ public class ScrollWithInput : MonoBehaviour
4647
/// </summary>
4748
[Tooltip("The input axis that handles scrolling in the x-axis.")]
4849
public string scrollInputAxisX = "";
50+
4951
#endif
5052

5153
/// <summary>
@@ -94,9 +96,7 @@ private void Update()
9496

9597
#if ENABLE_INPUT_SYSTEM
9698
input = scrollInput.ReadValue<Vector2>();
97-
#endif
98-
99-
#if ENABLE_LEGACY_INPUT_MANAGER
99+
#elif ENABLE_LEGACY_INPUT_MANAGER
100100
if (scrollInputAxisY != "") {
101101
input.y = Input.GetAxis(scrollInputAxisY);
102102
}

0 commit comments

Comments
 (0)