22 lines
368 B
C#
22 lines
368 B
C#
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();
|
|
}
|
|
}
|