public void AddToHistory(SketchModel.Serialization currentModel) { //remove steps that lie ahead of current position _history = _history.Take(_historyPosition + 1).ToList(); var json = JsonUtility.ToJson(currentModel); _fb.AddScore(json); _historyPosition = _history.Count; System.IO.File.WriteAllText($"{Application.persistentDataPath}/Serial{_historyPosition}.json", json); _history.Add(json); }
private void HistoryPositionChangedHandler(SketchModel.Serialization serializationToSet) { _model.Sketch.SetSerialization(serializationToSet); _model.InteractionState.Reset(); }