BGJ-2022.1/Assets/Scripts/UI/LevelButton.cs

17 lines
392 B
C#
Raw Normal View History

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;
private void Awake() => text = GetComponentInChildren<TMP_Text>();
public void SetLevel(string levelName) => text.text = levelName;
public void StartLevel() => LevelManager.Instance.SwitchToLevel(text.text);
}
}