Изменил размер шрифтов, переписал скрипт инактива

This commit is contained in:
Vladislav Likhenko 2024-08-12 13:44:41 +03:00
parent 8b71a920ae
commit 95532a1839
2 changed files with 26 additions and 11 deletions

View File

@ -1,5 +1,6 @@
using UnityEngine; using UnityEngine;
using UnityEngine.InputSystem; using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Controls;
public class TimerOnInactiveScript : MonoBehaviour public class TimerOnInactiveScript : MonoBehaviour
{ {
@ -28,23 +29,37 @@ public class TimerOnInactiveScript : MonoBehaviour
MoveCameraToRound(); MoveCameraToRound();
} }
InputSystem.onActionChange += (obj, change) => ///
/// Îòñëåæèâàíèå âçàèìîäåéñòâèÿ ââîäà-âûâîäà
///
//--------------------------------------------------------------------------------------------
foreach (var control in Gamepad.current.allControls)
{ {
if (change == InputActionChange.ActionPerformed) if (control is ButtonControl button && button.wasPressedThisFrame)
{ {
ResetTimer(); ResetTimer();
MoveCameraFromRound(); MoveCameraFromRound();
} }
};
//ResetTimer(); if (control is AxisControl axis)
//MoveCameraFromRound(); {
//if (Gamepad.current.) float value = axis.ReadValue();
//{ if (Mathf.Abs(value) > 0.1f) // Èãíîðèðóåì ìàëûå èçìåíåíèÿ
// //Debug.Log("êíîïêà íàæàòà"); {
// ResetTimer(); ResetTimer();
// MoveCameraFromRound(); MoveCameraFromRound();
//} }
}
}
if (Keyboard.current.wasUpdatedThisFrame)
{
ResetTimer();
MoveCameraFromRound();
}
//--------------------------------------------------------------------------------------------
} }
void MoveCameraToRound() void MoveCameraToRound()