feat: select levels keyboard shortcuts (next/previous with arrows) (#62)

This commit is contained in:
2025-05-15 07:12:03 +02:00
committed by GitHub
parent 7f2db297fa
commit 0263f6b3b0
4 changed files with 20 additions and 2 deletions

View File

@ -9,6 +9,14 @@ public class LevelNextButton : MonoBehaviour
levelsLoader = GameObject.FindGameObjectWithTag("LevelsLoader").GetComponent<LevelsLoader>();
}
public void Update()
{
if (Input.GetKeyDown(KeyCode.RightArrow))
{
NextLevel();
}
}
public void NextLevel()
{
levelsLoader.NextLevel();

View File

@ -9,6 +9,14 @@ public class LevelPreviousButton : MonoBehaviour
levelsLoader = GameObject.FindGameObjectWithTag("LevelsLoader").GetComponent<LevelsLoader>();
}
public void Update()
{
if (Input.GetKeyDown(KeyCode.LeftArrow))
{
PreviousLevel();
}
}
public void PreviousLevel()
{
levelsLoader.PreviousLevel();