File tree Expand file tree Collapse file tree 1 file changed +2
-27
lines changed Expand file tree Collapse file tree 1 file changed +2
-27
lines changed Original file line number Diff line number Diff line change 22using System . Collections . Generic ;
33using UnityEngine ;
44
5- #if ENABLE_INPUT_SYSTEM
6- using UnityEngine . InputSystem ;
7- #endif
85
96namespace 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
You can’t perform that action at this time.
0 commit comments