From 0263f6b3b0242fdb300d37b72aed1282d7f7bb34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20LUDWIG?= Date: Thu, 15 May 2025 07:12:03 +0200 Subject: [PATCH] feat: select levels keyboard shortcuts (next/previous with arrows) (#62) --- .../InGame/PortalsSkin/CubePortalLabelled.png.meta | 3 ++- .../InGame/PortalsSkin/ShipPortalLabelled.png.meta | 3 ++- Assets/Scripts/LevelsSelect/LevelNextButton.cs | 8 ++++++++ Assets/Scripts/LevelsSelect/LevelPreviousButton.cs | 8 ++++++++ 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/Assets/Resources/InGame/PortalsSkin/CubePortalLabelled.png.meta b/Assets/Resources/InGame/PortalsSkin/CubePortalLabelled.png.meta index a24ba88..0f5d43c 100644 --- a/Assets/Resources/InGame/PortalsSkin/CubePortalLabelled.png.meta +++ b/Assets/Resources/InGame/PortalsSkin/CubePortalLabelled.png.meta @@ -147,7 +147,8 @@ TextureImporter: secondaryTextures: [] spriteCustomMetadata: entries: [] - nameFileIdTable: {} + nameFileIdTable: + CubePortalLabelled_0: -799402021850825835 mipmapLimitGroupName: pSDRemoveMatte: 0 userData: diff --git a/Assets/Resources/InGame/PortalsSkin/ShipPortalLabelled.png.meta b/Assets/Resources/InGame/PortalsSkin/ShipPortalLabelled.png.meta index 1750308..c711c35 100644 --- a/Assets/Resources/InGame/PortalsSkin/ShipPortalLabelled.png.meta +++ b/Assets/Resources/InGame/PortalsSkin/ShipPortalLabelled.png.meta @@ -147,7 +147,8 @@ TextureImporter: secondaryTextures: [] spriteCustomMetadata: entries: [] - nameFileIdTable: {} + nameFileIdTable: + ShipPortalLabelled_0: -1834338360412052916 mipmapLimitGroupName: pSDRemoveMatte: 0 userData: diff --git a/Assets/Scripts/LevelsSelect/LevelNextButton.cs b/Assets/Scripts/LevelsSelect/LevelNextButton.cs index 6bc51ab..c85343d 100644 --- a/Assets/Scripts/LevelsSelect/LevelNextButton.cs +++ b/Assets/Scripts/LevelsSelect/LevelNextButton.cs @@ -9,6 +9,14 @@ public class LevelNextButton : MonoBehaviour levelsLoader = GameObject.FindGameObjectWithTag("LevelsLoader").GetComponent(); } + public void Update() + { + if (Input.GetKeyDown(KeyCode.RightArrow)) + { + NextLevel(); + } + } + public void NextLevel() { levelsLoader.NextLevel(); diff --git a/Assets/Scripts/LevelsSelect/LevelPreviousButton.cs b/Assets/Scripts/LevelsSelect/LevelPreviousButton.cs index 66fa47c..dab713c 100644 --- a/Assets/Scripts/LevelsSelect/LevelPreviousButton.cs +++ b/Assets/Scripts/LevelsSelect/LevelPreviousButton.cs @@ -9,6 +9,14 @@ public class LevelPreviousButton : MonoBehaviour levelsLoader = GameObject.FindGameObjectWithTag("LevelsLoader").GetComponent(); } + public void Update() + { + if (Input.GetKeyDown(KeyCode.LeftArrow)) + { + PreviousLevel(); + } + } + public void PreviousLevel() { levelsLoader.PreviousLevel();