uClicker
uClicker copied to clipboard
OnTick callback issue in ClickerManager
public void Tick()
{
bool updated = false;
foreach (Currency currency in Config.Currencies)
{
float amount = PerSecondAmount(currency);
updated = UpdateTotal(currency, amount);
}
UpdateUnlocks();
if (updated)
{
OnTick.Invoke();
}
}
Isn't the updated bool incorrectly assigned in the loop? If the last currency in an iteration isn't updated, it'll render no calls to OnTick events.