Skip to content

Commit 00c7836

Browse files
committed
Update ConsoleInGame.cs
1 parent e62b547 commit 00c7836

File tree

1 file changed

+2
-27
lines changed

1 file changed

+2
-27
lines changed

Runtime/ConsoleInGame.cs

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
using System.Collections.Generic;
33
using UnityEngine;
44

5-
#if ENABLE_INPUT_SYSTEM
6-
using UnityEngine.InputSystem;
7-
#endif
85

96
namespace Consolation
107
{
@@ -17,13 +14,9 @@ public class ConsoleInGame : MonoBehaviour
1714
{
1815
#region Inspector Settings
1916

20-
[Tooltip("Hotkey to show and hide the console.")]
21-
#if ENABLE_INPUT_SYSTEM
22-
[SerializeField] private Key toggleKey = Key.Backquote;
23-
#else
24-
[SerializeField]
17+
[Tooltip("Hotkey to show and hide the console.")] [SerializeField]
2518
private KeyCode toggleKey = KeyCode.BackQuote;
26-
#endif
19+
2720

2821
[Tooltip("Whether to open as soon as the game starts.")] [SerializeField]
2922
private bool openOnStart;
@@ -532,42 +525,24 @@ void TrimExcessLogs()
532525

533526
bool WasMultiTouchThresholdExceeded()
534527
{
535-
#if ENABLE_INPUT_SYSTEM
536-
var touchCount = UnityEngine.InputSystem.EnhancedTouch.Touch.activeTouches.Count;
537-
#else
538528
var touchCount = Input.touchCount;
539-
#endif
540-
541529
return touchCount > 2;
542530
}
543531

544532
bool WasShaken()
545533
{
546-
#if ENABLE_INPUT_SYSTEM
547-
var acceleration = Accelerometer.current?.acceleration.ReadValue() ?? Vector3.zero;
548-
#else
549534
var acceleration = Input.acceleration;
550-
#endif
551-
552535
return acceleration.sqrMagnitude > shakeAcceleration;
553536
}
554537

555538
bool WasToggleKeyPressed()
556539
{
557-
#if ENABLE_INPUT_SYSTEM
558-
return Keyboard.current[toggleKey].wasPressedThisFrame;
559-
#else
560540
return Input.GetKeyDown(toggleKey);
561-
#endif
562541
}
563542

564543
static void EnableMultiTouch()
565544
{
566-
#if ENABLE_INPUT_SYSTEM
567-
UnityEngine.InputSystem.EnhancedTouch.EnhancedTouchSupport.Enable();
568-
#else
569545
Input.multiTouchEnabled = true;
570-
#endif
571546
}
572547
}
573548

0 commit comments

Comments
 (0)