private void UpdateFourthFertilizer(object source, FertilizerEventArgs args) { bool ApplyAnimation = false; if (args.Amount <= 4) { ApplyAnimation = true; } Dispatch(() => { if (ApplyAnimation) { ANIM_FERTILIZER_EXPIRE.Begin(fert4Counter, true); ANIM_FERTILIZER_EXPIRE.Begin(fert4Name, true); } else { ANIM_FERTILIZER_EXPIRE.Remove(fert4Counter); ANIM_FERTILIZER_EXPIRE.Remove(fert4Name); } this.fert4Name.Content = args.Name; this.fert4Counter.Content = $"x{args.Amount}"; }); }
protected virtual void _onAmountUpdate() { FertilizerEventArgs args = new FertilizerEventArgs(this); OnAmountUpdate?.Invoke(this, args); }
protected virtual void _onFertilizerChange() { FertilizerEventArgs args = new FertilizerEventArgs(this); OnFertilizerChange?.Invoke(this, args); }