using Beyond; using System.Collections; using System.Collections.Generic; using UnityEngine; namespace Beyond { public class InteractionChestStep : MonoBehaviour { public BaseStepController baseStepController; // private List interacted = new(); public List objectsToInteractwith = new(); private bool interactedWith; private void Start() { // objectsToInteractwith.ForEach(obj => interacted.Add(false)); if (objectsToInteractwith[0] != null) { baseStepController.OnEvaluationStart += () => objectsToInteractwith.ForEach(obj => obj.SetActive(true)); baseStepController.OnCompleted += () => { objectsToInteractwith.ForEach(obj => { if (obj != null) { obj.SetActive(false); } }); }; // baseStepController.EvaluateInputs += () => !interacted.Exists(inter => inter == false); baseStepController.ConditionsAreMet += () => interactedWith; } } public void MarkAsInteractedWith() { interactedWith = true; } } }