Files
Jeremy/Assets/Scripts/Counter.cs
T

22 lines
368 B
C#
Raw Normal View History

2025-01-05 17:13:12 +01:00
using UnityEngine;
using UnityEngine.Events;
public class Counter : MonoBehaviour
{
[SerializeField]
private int _count = 0;
[SerializeField]
private int _maxCount = 4;
[SerializeField]
private UnityEvent _onAllDone;
public void Count()
{
_count++;
if(_count>=_maxCount)
_onAllDone.Invoke();
}
}