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

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