r2mods/ilspy_dump/ror2_csproj/RoR2.EntityLogic/Counter.cs

28 lines
373 B
C#
Raw Normal View History

2024-10-04 07:26:37 +00:00
using UnityEngine;
using UnityEngine.Events;
namespace RoR2.EntityLogic;
public class Counter : MonoBehaviour
{
public int value;
public int threshold;
public UnityEvent onTrigger;
public void Add(int valueToAdd)
{
value += valueToAdd;
if (value >= threshold)
{
onTrigger.Invoke();
}
}
public void SetValue(int newValue)
{
value = newValue;
}
}