BGJ-2022.1/Assets/Scripts/Level/LevelEnd.cs

19 lines
402 B
C#

namespace Level
{
using UnityEngine;
public class LevelEnd : MonoBehaviour
{
private Level level = null;
private void Awake() => level = GetComponentInParent<Level>();
public void EndLevel()
{
level.EndLevel();
Debug.Log(level.LevelNumber);
LevelManager.Instance.SwitchToLevel(level.LevelNumber + 1);
}
}
}