2022-02-24 00:21:59 +03:00
|
|
|
using Level;
|
|
|
|
using TMPro;
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
namespace UI
|
|
|
|
{
|
|
|
|
public class LevelButton : MonoBehaviour
|
|
|
|
{
|
|
|
|
private TMP_Text text = null;
|
2022-02-26 12:56:49 +03:00
|
|
|
public int LevelNumber { get; private set; } = 0;
|
2022-02-24 00:21:59 +03:00
|
|
|
|
|
|
|
private void Awake() => text = GetComponentInChildren<TMP_Text>();
|
|
|
|
|
2022-02-26 12:56:49 +03:00
|
|
|
public void SetLevel(string levelName)
|
|
|
|
{
|
|
|
|
text.text = levelName;
|
|
|
|
LevelNumber = System.Int32.Parse(levelName);
|
|
|
|
}
|
|
|
|
public void StartLevel() => LevelManager.Instance.SwitchToLevel(LevelNumber);
|
2022-02-24 00:21:59 +03:00
|
|
|
}
|
|
|
|
}
|