Files
beyond/Assets/Scripts/Tutorial/InteractionChestStep.cs
2024-11-20 15:21:28 +01:00

44 lines
1.3 KiB
C#

using Beyond;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Beyond
{
public class InteractionChestStep : MonoBehaviour
{
public BaseStepController baseStepController;
// private List<bool> interacted = new();
public List<GameObject> 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;
}
}
}