Ejemplo n.º 1
0
    private void Awake()
    {
        var crates = GetComponentsInChildren <Crate>();

        TotalCount = crates.Length;
        foreach (var crate in crates)
        {
            crate.Destroying += () => CurrentCountChanged?.Invoke(++CurrentCount);
        }
    }
Ejemplo n.º 2
0
 public void IncrementCountAsync()
 {
     CurrentCount += IncrementAmount;
     CurrentCountChanged?.Invoke(CurrentCount);
 }