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

28 lines
871 B
C#

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