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

This commit is contained in:
Théo LUDWIG 2025-05-15 07:12:03 +02:00 committed by GitHub
parent 7f2db297fa
commit 0263f6b3b0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 20 additions and 2 deletions

View File

@ -147,7 +147,8 @@ TextureImporter:
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
nameFileIdTable:
CubePortalLabelled_0: -799402021850825835
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:

View File

@ -147,7 +147,8 @@ TextureImporter:
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
nameFileIdTable:
ShipPortalLabelled_0: -1834338360412052916
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:

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();