using System.Collections; using System.Collections.Generic; using UnityEngine; namespace Beyond { public class ConsumeFaithStep : MonoBehaviour { public BaseStepController baseStepController; private bool hasUpdatedFaith = false; // Start is called before the first frame update private void Start() { baseStepController.OnStarted += () => { Player.Instance.ItemManager.onUseItem.AddListener(TryToMarkAsFaithUpdated); }; baseStepController.ConditionsAreMet += () => hasUpdatedFaith; } public void TryToMarkAsFaithUpdated(bItem item) { if (item.type == bItemType.ConsumablesFaith) { hasUpdatedFaith = true; Player.Instance.ItemManager.onUseItem.RemoveListener(TryToMarkAsFaithUpdated); } } } }