Skip to content

Commit ca6b4df

Browse files
authored
Merge pull request #97 from ExtendRealityLtd/fix/ifdef-2019_2
fix(state): only apply ifdef on Unity 2019.2 or newer
2 parents a6ed746 + 198dd16 commit ca6b4df

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,10 +47,14 @@ public float Multiplier
4747
/// <inheritdoc />
4848
public void Process()
4949
{
50+
#if UNITY_2019_2_OR_NEWER
5051
#if ENABLE_LEGACY_INPUT_MANAGER
5152
Receive(Input.GetAxis(AxisName) * Multiplier);
5253
#else
5354
Debug.LogWarning("The Legacy Unity Input Manager is disabled in the player settings.");
55+
#endif
56+
#else
57+
Receive(Input.GetAxis(AxisName) * Multiplier);
5458
#endif
5559
}
5660
}

Runtime/SharedResources/Scripts/UnityInputManagerAxis2DAction.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,14 @@ public float YMultiplier
8181
/// <inheritdoc />
8282
public void Process()
8383
{
84+
#if UNITY_2019_2_OR_NEWER
8485
#if ENABLE_LEGACY_INPUT_MANAGER
8586
Receive(new Vector2(Input.GetAxis(XAxisName) * XMultiplier, Input.GetAxis(YAxisName) * YMultiplier));
8687
#else
8788
Debug.LogWarning("The Legacy Unity Input Manager is disabled in the player settings.");
89+
#endif
90+
#else
91+
Receive(new Vector2(Input.GetAxis(XAxisName) * XMultiplier, Input.GetAxis(YAxisName) * YMultiplier));
8892
#endif
8993
}
9094
}

Runtime/SharedResources/Scripts/UnityInputManagerButtonAction.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,14 @@ public KeyCode KeyCode
3030
/// <inheritdoc />
3131
public void Process()
3232
{
33+
#if UNITY_2019_2_OR_NEWER
3334
#if ENABLE_LEGACY_INPUT_MANAGER
3435
Receive(Input.GetKey(KeyCode));
3536
#else
3637
Debug.LogWarning("The Legacy Unity Input Manager is disabled in the player settings.");
38+
#endif
39+
#else
40+
Receive(Input.GetKey(KeyCode));
3741
#endif
3842
}
3943
}

0 commit comments

Comments
 (0)