Изменил размер шрифтов, переписал скрипт инактива
This commit is contained in:
parent
8b71a920ae
commit
95532a1839
Binary file not shown.
@ -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()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user