Implement all levels.
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
|
||||
public class Circuit_puzzle : MonoBehaviour
|
||||
{
|
||||
public List<Circuit> battaries;
|
||||
|
||||
public LevelManager levelManager;
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
bool allOn = true;
|
||||
foreach (var battery in battaries)
|
||||
{
|
||||
if (!battery.isOn)
|
||||
{
|
||||
allOn = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (allOn)
|
||||
{
|
||||
levelManager.LevelFinishEvent();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user