mirror of
https://github.com/boudji-ludwig-pett/cnam-geometry-dash.git
synced 2025-06-27 11:58:51 +02:00
feat: navigate between previous and next levels
This commit is contained in:
@ -1,15 +1,19 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class LevelNameText : MonoBehaviour
|
||||
{
|
||||
public LevelsLoader levelsLoader;
|
||||
public Text levelNameText;
|
||||
public LevelsLoader levelsLoader;
|
||||
|
||||
public void Start()
|
||||
{
|
||||
levelsLoader = GameObject.FindGameObjectWithTag("LevelsLoader").GetComponent<LevelsLoader>();
|
||||
levelNameText.text = levelsLoader.level.name;
|
||||
levelNameText.text = levelsLoader.levelCurrent.name;
|
||||
}
|
||||
|
||||
public void Update()
|
||||
{
|
||||
levelNameText.text = levelsLoader.levelCurrent.name;
|
||||
}
|
||||
}
|
||||
|
@ -2,8 +2,15 @@ using UnityEngine;
|
||||
|
||||
public class LevelNextButton : MonoBehaviour
|
||||
{
|
||||
public LevelsLoader levelsLoader;
|
||||
|
||||
public void Start()
|
||||
{
|
||||
levelsLoader = GameObject.FindGameObjectWithTag("LevelsLoader").GetComponent<LevelsLoader>();
|
||||
}
|
||||
|
||||
public void NextLevel()
|
||||
{
|
||||
// TODO
|
||||
levelsLoader.NextLevel();
|
||||
}
|
||||
}
|
||||
|
@ -2,8 +2,15 @@ using UnityEngine;
|
||||
|
||||
public class LevelPreviousButton : MonoBehaviour
|
||||
{
|
||||
public LevelsLoader levelsLoader;
|
||||
|
||||
public void Start()
|
||||
{
|
||||
levelsLoader = GameObject.FindGameObjectWithTag("LevelsLoader").GetComponent<LevelsLoader>();
|
||||
}
|
||||
|
||||
public void PreviousLevel()
|
||||
{
|
||||
// TODO
|
||||
levelsLoader.PreviousLevel();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user