29 lines
862 B
C#
29 lines
862 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace Beyond
|
|
{
|
|
public class ConsumeHealingStep : MonoBehaviour
|
|
{
|
|
public BaseStepController baseStepController;
|
|
|
|
private bool hasUpdatedHealth = false;
|
|
|
|
// Start is called before the first frame update
|
|
private void Start()
|
|
{
|
|
baseStepController.OnStarted += () => { Player.Instance.ItemManager.onUseItem.AddListener(TryToMarkAsHPUpdated); };
|
|
baseStepController.ConditionsAreMet += () => hasUpdatedHealth;
|
|
}
|
|
|
|
public void TryToMarkAsHPUpdated(bItem item)
|
|
{
|
|
if (item.type == bItemType.Consumable)
|
|
{
|
|
hasUpdatedHealth = true;
|
|
Player.Instance.ItemManager.onUseItem.RemoveListener(TryToMarkAsHPUpdated);
|
|
}
|
|
}
|
|
}
|
|
} |