using System.Collections; using System.Collections.Generic; using UnityEngine; public class DoActionBreakAllLightsWithDelay : MonoBehaviour { BreakLightsWithDelay breakAllLightsWithDelay; bool ActionPerformed; private void Awake() { breakAllLightsWithDelay = GetComponent(); } // Update is called once per frame void Update() { if (breakAllLightsWithDelay.AllLightsAreBroken() && !ActionPerformed) { GameManagerEarly.GetInstance().DoAction = true; ActionPerformed = true; print("Action Performed in BreakLightsWithDelay"); } } }