public void loadPlayer() { PlayerData data = SavingScript.loadPlayer(); _currentBench = data.Currentbench; _currentScene = data.CurrentScene; }
/// <summary> /// Saves a <see cref="Script"/> /// </summary> /// <param name="script"><see cref="Script"/> to save</param> /// <param name="userId"></param> public void SaveScript(Script script, int userId = 0) { if (SavingScript.IsRaisedEventCancelled(new SaveEventArgs<Script>(script), this)) return; var uow = _fileUowProvider.GetUnitOfWork(); using (var repository = _repositoryFactory.CreateScriptRepository(uow)) { repository.AddOrUpdate(script); uow.Commit(); SavedScript.RaiseEvent(new SaveEventArgs<Script>(script, false), this); } Audit(AuditType.Save, string.Format("Save Script performed by user"), userId, -1); }
public void LoadProgress() { string path = Application.persistentDataPath + "/player.dont"; if (File.Exists(path)) { PlayerData data = SavingScript.LoadProgress(); distanceBuffer = data.distance; subsBuffer = data.subs; twoMilionAwardBuffer = data.twoMilionAward; waveBuffer = data.wave; levelBuffer = data.level; showAwardBuffer = data.showAward; } else { SaveProgress(); } ProgressUpdate(); }
public void createSave() { _currentScene = 3; _currentBench = 1; SavingScript.savePlayer(this); }
public void savePlayer() { Debug.Log("saving"); SavingScript.savePlayer(this); }
public void SaveProgress() { SavingScript.SaveProgress(this); }