public RewindOperation(IEnumerable <Player> players, IEnumerable <Ghost> ghosts, Action onComplete) { _onComplete = onComplete; ParticipatingPlayers.AddRange(players); RemainingPlayers.AddRange(players); ParticipatingGhosts.AddRange(ghosts); RemainingGhosts.AddRange(ghosts); //Kill all projectiles var projectiles = Scene.Current.FindGameObjects <Projectile>(); foreach (var item in projectiles) { item.DisposeLater(); } //And remove all active status effects. foreach (var item in ParticipatingPlayers) { item.RemoveAllStatusEffects(); } //Turn on replay for all players. foreach (var player in ParticipatingPlayers) { DisablePlayer(player); player.TimeBody.StartRewind(2, true, () => { FinishPlayerDeathRewind(player); }); } //Turn on replay for all ghosts. foreach (var ghost in ParticipatingGhosts) { ghost.TimeBody.StartRewind(2, false, () => { FinishGhostDeathRewind(ghost); }); } }