try to fix weird score bug

controller only gets re-assigned on first boot
don't stall the cpu to queue frames
This commit is contained in:
minenice55
2024-01-16 15:21:22 -05:00
parent 7f15ce82c1
commit b6ec60ca92
5 changed files with 22 additions and 21 deletions

View File

@ -56,6 +56,7 @@ namespace HeavenStudio
[SerializeField] private RectTransform selectedDisplayRect;
[SerializeField] private GameObject selectedDisplayIcon;
[SerializeField] private GameObject[] otherHiddenOnMouse;
static bool firstBoot = true;
private AudioSource musicSource;
@ -80,6 +81,7 @@ namespace HeavenStudio
private RectTransform currentSelectableRect, lastSelectableRect;
private float selectableLerpTimer;
private void Start()
{
exiting = false;
@ -151,15 +153,16 @@ namespace HeavenStudio
var nextController = newController;
var lastController = PlayerInput.GetInputController(1);
if ((newController is InputMouse) && (lastController is not InputMouse))
if ((newController is InputMouse) && !(lastController is InputMouse))
{
Debug.Log("Mouse used, selecting keyboard instead");
nextController = controllers[0];
}
Debug.Log("Assigning controller: " + newController.GetDeviceName());
if (lastController != nextController)
if (lastController != nextController && !firstBoot)
{
firstBoot = false;
if (nextController == null)
{
Debug.Log("invalid controller, using keyboard");