mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-12 21:37:40 +02:00
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:
@ -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");
|
||||
|
Reference in New Issue
Block a user