Implement all levels.
This commit is contained in:
@@ -7,6 +7,8 @@ public class LevelManager : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private List<GameObject> enemiesList;
|
||||
public UnityEvent onLevelComplete;
|
||||
|
||||
public UnityEvent levelCompleteCondition;
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
@@ -16,13 +18,17 @@ public class LevelManager : MonoBehaviour
|
||||
// Update is called once per frame
|
||||
|
||||
void Update()
|
||||
{
|
||||
levelCompleteCondition?.Invoke();
|
||||
}
|
||||
|
||||
public void CheckIfNoEnemies()
|
||||
{
|
||||
if (enemiesList.Count == 0)
|
||||
{
|
||||
LevelFinishEvent();
|
||||
}
|
||||
}
|
||||
|
||||
public void AddEnemyToList(GameObject enemy)
|
||||
{
|
||||
enemiesList.Add(enemy);
|
||||
|
||||
Reference in New Issue
Block a user