Files
laser-game/Assets/Circuit_puzzle.cs
2025-04-28 00:42:18 +03:00

37 lines
682 B
C#

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();
}
}
}