You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
368 B
22 lines
368 B
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();
|
|
}
|
|
}
|