private void Start() { Cursor.lockState = CursorLockMode.None; Cursor.visible = true; if (GameSaveLoad.IsPlayerDead) { this.Image.color = Color.black; this.FinalText.color = Color.white; this.FinalText.text = Resources.Various.PlayerDeadText; } else { this.Image.color = Color.white; this.FinalText.color = Color.black; this.FinalText.text = Resources.Various.FinalText; } this.gameObject.FindChildrenByName("EndGameMenu")[0].SetActive(GameSaveLoad.IsPlayerDead == false); this.gameObject.FindChildrenByName("PlayerDeadMenu")[0].SetActive(GameSaveLoad.IsPlayerDead); if (this.LoadSaveButton) { this.LoadSaveButton.gameObject.SetActive(GameSaveLoad.IsPlayerDead == true); this.LoadSaveButton.GetComponent <Button>().interactable = GameSaveLoad.HasSave(); } }
// Use this for initialization void Start() { // #if UNITY_EDITOR // if (workSpace == null) { // Debug.LogWarning ("Falta que"); // Debug.Break (); // } // #endif dataForRead = new InfoPartida(); dataForRead = GameSaveLoad.Load(GameSaveLoad._FileLocation + "\\" + GameSaveLoad._PacienteName + "_DataSandwich.xml"); _nombrePaciente = dataForRead.nombre; _noPartidasJugadasNivel1 = dataForRead.HistorialPartidasNivel1.Count; _noPartidasJugadasNivel2 = dataForRead.HistorialPartidasNivel2.Count; _noPartidasJugadasNivel3 = dataForRead.HistorialPartidasNivel3.Count; nombrePaciente.text = "Nombre: " + _nombrePaciente.ToString(); noPartidasJugadasNivel1.text = "Partidas jugadas del nivel 1: " + _noPartidasJugadasNivel1.ToString(); noPartidasJugadasNivel2.text = "Partidas jugadas del nivel 2: " + _noPartidasJugadasNivel2.ToString(); noPartidasJugadasNivel3.text = "Partidas jugadas del nivel 3: " + _noPartidasJugadasNivel3.ToString(); _fechaPartidaNivel1 = dataForRead.HistorialPartidasNivel1 [_noPartidasJugadasNivel1 - 1].fecha.ToString(); _fechaPartidaNivel2 = dataForRead.HistorialPartidasNivel2 [_noPartidasJugadasNivel2 - 1].fecha.ToString(); _fechaPartidaNivel3 = dataForRead.HistorialPartidasNivel3 [_noPartidasJugadasNivel3 - 1].fecha.ToString(); ComparaFechasEntrePartidas(_fechaPartidaNivel1, _fechaPartidaNivel2, _fechaPartidaNivel3); MuestraDatosUltimaPartida(); }
private void Start() { this.ProgressInGame.IsPlayerDead = false; this.RegisterEvents(); this.player = GameObject.FindGameObjectWithTag(Resources.Tags.Player); this.shipEngine = GameObject.FindGameObjectWithTag(Resources.Tags.Ship).GetComponent <ShipEngineScript>(); this.tasks = GameObject.FindGameObjectWithTag(Resources.Tags.Tasks); this.infoText = GameObject.FindGameObjectWithTag(Resources.Tags.InfoText); this.pauseMenu = GameObject.FindGameObjectWithTag(Resources.Tags.PauseMenu); this.pauseMenu.SetActive(false); this.repairSlider = GameObject.FindGameObjectWithTag(Resources.Tags.RepairSlider).GetComponent <Slider>(); this.repairSlider.gameObject.SetActive(false); Transform[] baseCommandersSpawnPoints = Array.ConvertAll(GameObject.FindGameObjectsWithTag(Resources.Tags.BaseCommanderSpawnPoint), item => item.transform); Transform[] commandersSpawnPoints = Array.ConvertAll(GameObject.FindGameObjectsWithTag(Resources.Tags.CommanderSpawnPoint), item => item.transform); Transform[] soldiersSpawnPoints = Array.ConvertAll(GameObject.FindGameObjectsWithTag(Resources.Tags.SoldierSpawnPoint), item => item.transform); Transform[] workersSpawnPoints = Array.ConvertAll(GameObject.FindGameObjectsWithTag(Resources.Tags.WorkerSpawnPoint), item => item.transform); this.ManageEnemies.SetSpawnPoints(baseCommandersSpawnPoints, commandersSpawnPoints, soldiersSpawnPoints, workersSpawnPoints); // load saved game or start new... this.ProgressInGame = (GameSaveLoad.LoadSavedGame ? GameSaveLoad.Load() : new GameProgress()); this.ReadGameProgress(GameSaveLoad.LoadSavedGame); }
//Load en Jugador_Interfaz al comenzar el juego private void OnTriggerEnter(Collider other) //Guardar { int n = PartidasControl.Instance.NPartida; GameSaveLoad.Save(n, player); player.HablarMensaje("Partida ha sido guardada"); }
/// <summary> /// executed when the game is saved /// </summary> private void OnSaveGame() { // save current game progress GameSaveLoad.Save(this.ProgressInGame); // go to main menu EventManager.Emit(Resources.Events.GoToMenu); }
// Here we deserialize it back into its original form public object DeserializeObject(string pXmlizedString) { XmlSerializer xs = new XmlSerializer(typeof(RutinaData)); MemoryStream memoryStream = new MemoryStream(GameSaveLoad.StringToUTF8ByteArray(pXmlizedString)); XmlTextWriter xmlTextWriter = new XmlTextWriter(memoryStream, Encoding.UTF8); return(xs.Deserialize(memoryStream)); }
void Awake() { EntregaResultado(); RedondeaSegundos(); Admin_level0.datos.HistorialPartidasNivel1.Add(AdminMenu.datosNivel1); GameSaveLoad.Save(Admin_level0.datos); StartCoroutine(GameSaveLoad.IfNewUploadXMLToServer()); }
void Start() { numeroDeRepeticiones.text = "No. Repeticiones: " + Admin_level0.datosNivel2.numeroDeRepeticiones; numeroDeIngredientes.text = "No. Ingredientes por repetición: " + Admin_level0.datosNivel2.Rutina.Count; Admin_level0.datos.HistorialPartidasNivel2.Add(Admin_level0.datosNivel2); GameSaveLoad.Save(Admin_level0.datos); StartCoroutine(GameSaveLoad.IfNewUploadXMLToServer()); Admin_level0.datosNivel2.nombreDeRutina = Admin_level0.NombreRutinaTemp; }
private void Start() { foreach (string name in GameSaveLoad.GetNames()) { if (name == GameManager.instance.playerName) { return; } } }
void EndGameCalculations() { assessmentCanvas.SetActive(true); GameSaveLoad.SaveGame(); highscoreNames.Add(playerName); highscoreTimes.Add(timeTaken); highscoreScores.Add(ScoreAssessment.instance.GetTotalScore()); Invoke("DisplayHighScore", 10.0f); }
public static void Load(string dataPath) { stuffContainer = LoadStuff(dataPath); foreach (StuffData data in stuffContainer.stuff) { GameSaveLoad.CreateStuff(data, GameSaveLoad.stuffPath[data.name], data.pos, Quaternion.identity); } OnLoaded(); ClearStuffList(); }
public void Load() { GameData data = GameSaveLoad.Load(PartidasControl.Instance.NPartida); vida = data.vida; baulMateriales.listaObjetos = data.baulObjetos; Vector3 pos = new Vector3(); pos.x = data.playerPos[0]; pos.y = data.playerPos[1]; pos.z = data.playerPos[2]; transform.SetPositionAndRotation(pos, Quaternion.identity); }
private void SetupButtonsForLoadingSaves() { // enable buttons if there is a save if (this.LoadSaveButton != null) { this.LoadSaveButton.GetComponent <Button>().interactable = GameSaveLoad.HasSave(); } if (this.DeleteSaveButton) { this.DeleteSaveButton.GetComponent <Button>().interactable = GameSaveLoad.HasSave(); } }
public static void Save() { _saveData = new GameSaveLoad.SaveData(); foreach (var item in _pathNames) { var data = StageData[item]; _saveData.SetData(item + "_Score", data.Score); _saveData.SetData(item + "_Accuracy", data.Accuracy); _saveData.SetData(item + "_MaxCombo", data.MaxCombo); } GameSaveLoad.SaveGameFile(SaveDataKey, 0, _saveData); Load(_pathNames); }
public void OnClick_SiGuardarCambios() { BotonesInferior.SetActive(false); int n = PartidasControl.Instance.NPartida; GameSaveLoad.Save(n, Jugador.GetComponent <Jugador>()); switch (menuOSalir) { case 1: SceneManager.LoadScene(nombreSceneMenu); break; case 2: Application.Quit(); break; } }
public void SaveAndLoad_CorrectGame_SavedAndLoaded() { Game game = new Game(); for (int i = 0; i < 1200; i++) { game.NextTurn(); } string path = @"C:\Users\Tom\Desktop\test save.dat"; GameSaveLoad.Save(game, path); Game loadedGame = GameSaveLoad.Load(path); Assert.AreEqual(game.Player.OwnedPlanets, loadedGame.Player.OwnedPlanets); }
private void Awake() { dataPath = System.IO.Path.Combine(Application.dataPath, "stuff.json"); stuffPath.Add("Box1", "Prefabs/Box1"); stuffPath.Add("Box2", "Prefabs/Box2"); stuffPath.Add("Box3", "Prefabs/Box3"); stuffPath.Add("Platform3x1", "Prefabs/Platform3x1"); stuffPath.Add("Platform4x1", "Prefabs/Platform4x1"); stuffPath.Add("Platform5x1", "Prefabs/Platform5x1"); stuffPath.Add("Platform6x1", "Prefabs/Platform6x1"); stuffPath.Add("Platform7x1", "Prefabs/Platform7x1"); if (instance == null) { instance = this; } platformGen = platformGen.GetComponent <PlatformGenerator>(); }
void Awake() { _repeticiones = AdminMenu.datosNivel3.numeroDeRepeticiones; _cantidadDePan = 0; _cantidadDeJamon = 0; _cantidadDeQueso = 0; _cantidadDeJitomate = 0; _erroresPan = 0; _erroresJamon = 0; _erroresQueso = 0; _erroresJitomate = 0; CuentaIngredientesAleatorios(); CuentaErrores(); EntregaInformacion(); EntregaPorcentajeError(); RedondeoTiempos(); Admin_level0.datos.HistorialPartidasNivel3.Add(AdminMenu.datosNivel3); GameSaveLoad.Save(Admin_level0.datos); StartCoroutine(GameSaveLoad.IfNewUploadXMLToServer()); }
public static void Load(string[] pathNames) { StageData = new Dictionary <string, StageData>(); _saveData = GameSaveLoad.LoadGameFile(SaveDataKey, 0); _pathNames = pathNames; foreach (var item in pathNames) { if (StageData.ContainsKey(item)) { continue; } var data = new StageData { Score = _saveData.GetIntData(item + "_Score", 0), Accuracy = _saveData.GetFloatData(item + "_Accuracy", 0.0f), MaxCombo = _saveData.GetIntData(item + "_MaxCombo", 0) }; StageData.Add(item, data); } }
public void UpdateState(GameState newState) { state = newState; switch (state) { case GameState.Loading: GameSaveLoad.LoadScore(); break; case GameState.Title: break; case GameState.Test: isInitializing = true; Invoke("StartTestMode", 2.0f); break; case GameState.Guided: Invoke("StartGuidedMode", 2.0f); break; } }
private static void LoadGameWithIncorrectPath() { string path = @"C:\test.dat"; Game loadedGame = GameSaveLoad.Load(path); }
public void DeleteSavedGame() { GameSaveLoad.DeleteSave(); this.SetupButtonsForLoadingSaves(); }