private async Task PushRollbackSnapshotAsync(Commands.Command executedCommand) { var state = new GameStateMap(); state.SaveDateTime = DateTime.Now; await SaveAllServicesToStateAsync <IStatefulService <GameStateMap>, GameStateMap>(state); foreach (var task in onGameSerializeTasks) { await task(state); } rollbackStateStack.Push(state); }
private void HighlightPlayedCommand(Commands.Command command) { if (!ObjectUtils.IsValid(scriptAsset) || command is null || command.ScriptName != scriptAsset.name || !lines.IsIndexValid(command.LineIndex) || !ViewRange.Contains(command.LineIndex)) { return; } var prevPlayedLine = linesContainer.Q <ScriptLineView>(className: playedLineClass); prevPlayedLine?.RemoveFromClassList(playedLineClass); var playedLine = lines[command.LineIndex]; playedLine.AddToClassList(playedLineClass); }
private UniTask HandleCommandPreExecution(Commands.Command _) { PushRollbackSnapshot(false); return(UniTask.CompletedTask); }