mirror of
https://github.com/boudji-ludwig-pett/cnam-geometry-dash.git
synced 2025-06-10 22:20:40 +02:00
feat: select levels keyboard shortcuts (next/previous with arrows) (#62)
This commit is contained in:
@ -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();
|
||||
|
@ -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();
|
||||
|
Reference in New Issue
Block a user