/// <summary> /// Attempts to rollback (revert) all the engine services to a state they had at the provided playback spot. /// Has no effect when the rollback feature is disabled. /// </summary> /// <param name="playbackSpot">The playback spot to revert to.</param> /// <returns>Whether the provided playback spot was found in the rollback stack and the operation succeeded.</returns> public async Task <bool> RollbackAsync(PlaybackSpot playbackSpot) { var state = rollbackStateStack.Pop(playbackSpot); if (state is null) { return(false); } await RollbackToStateAsync(state); return(true); }
public async UniTask <bool> RollbackAsync(Predicate <GameStateMap> predicate) { var state = rollbackStack.Pop(predicate); if (state is null) { return(false); } await RollbackToStateAsync(state); return(true); }