public void Update(LevelTime levelTime) { while (idx < list.Count && levelTime.SongPosition >= TimeSelector.Invoke(list[idx])) { var time = TimeSelector.Invoke(list[idx]); var lateBy = levelTime.SongPosition - time; var args = new TimeIterActionArgs <T>() { List = list, Index = idx, LevelTime = levelTime, LateBy = lateBy, }; Action.Invoke(args); idx++; } }
private void OnFireShot(TimeIterActionArgs <Shot> args) { var newBullets = shotCreator.FireShot(args.List[args.Index], spawners, playerCenter); Bullets.AddRange(newBullets); }