Skip to content

Commit 743fa21

Browse files
committed
D-Pad Visibility and Error Messages
1 parent 5fe7bad commit 743fa21

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

Assets/Scripts/CameraMovement.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@ private void Awake()
1818
Debug.LogWarning("ERROR: DPadController reference is missing.");
1919
}
2020

21-
if (walkSpeed < 0 || CamSensitivity < 0)
21+
if (walkSpeed <= 0 || CamSensitivity <= 0)
2222
{
2323
Debug.LogWarning("ERROR: WalkSpeed and Camera Sensitivity is invalid");
2424
}
25+
26+
2527
}
2628

2729
private void OnEnable()

Assets/Scripts/DPadController.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,18 @@
22
using UnityEngine.InputSystem;
33

44
public class DPadController : MonoBehaviour
5+
56
{
7+
[SerializeField] private GameObject dpadUI;
8+
9+
private void Awake()
10+
{
11+
if (dpadUI != null)
12+
{
13+
dpadUI.SetActive(Application.isMobilePlatform);
14+
}
15+
}
16+
617
private Vector2 dPadInput;
718

819
public void OnDPadUpPressed(InputAction.CallbackContext context)

0 commit comments

Comments
 (0)