public void LoadScene() { IDCreator.ResetIDs(); IDHolder.ClearIDHoldersList(); Command.CommandQueue.Clear(); Command.CommandExecutionComplete(); string buttonClicked = EventSystem.current.currentSelectedGameObject.name; switch (buttonClicked) { case "PlayerVsAI": GameManager.IsHeadlessMode = false; SceneManager.LoadScene("Scene_PlayervsAI"); break; case "AIvsAI": GameManager.IsHeadlessMode = true; SceneManager.LoadScene("Scene_AIvsAI"); break; case "Quit": Application.Quit(); break; case "Menu": SceneManager.LoadScene("Scene_Menu"); break; default: SceneManager.LoadScene("Scene_Menu"); break; } }
public void ReloadScene() { IDFactory.ResetIDs(); IDHolder.ClearIDHoldersList(); Command.OnSceneReload(); SceneManager.LoadScene(SceneManager.GetActiveScene().name); }
public void StartGame() { //reset all card IDs IDFactory.ResetIDs(); IDHolder.ClearIDHoldersList(); Command.OnSceneReload(); SceneManager.LoadScene("InGame"); }
public void ReloadScene() { Debug.Log("Scene reloaded"); IDFactory.ResetIDs(); IDHolder.ClearIDHoldersList(); Command.CommandQueue.Clear(); Command.CommandExecutionComplete(); SceneManager.LoadScene(SceneManager.GetActiveScene().name); }
public void ReloadScene() { // Command has some static members, so let`s make sure that there are no commands in the Queue Debug.Log("Scene reloaded"); // reset all card and creature IDs IDFactory.ResetIDs(); IDHolder.ClearIDHoldersList(); Command.OnSceneReload(); SceneManager.LoadScene(SceneManager.GetActiveScene().name); }
public void ReturnToMenu() { Debug.Log("Returning to Main Menu"); // reset all card and creature IDs IDFactory.ResetIDs(); IDHolder.ClearIDHoldersList(); Command.CommandQueue.Clear(); Command.CommandExecutionComplete(); // probably find a better way to do this later SceneManager.LoadScene(mainMenu); }
public void Die() { // game over // block both players from taking new moves //Debug.Log("Player is " + gameObject.name); if (gameObject.name != "Player1 - LOW") { new ShowMessageCommand("You win!", 2.0f).AddToQueue(); IDFactory.ResetIDs(); IDHolder.ClearIDHoldersList(); Command.CommandQueue.Clear(); Command.CommandExecutionComplete(); if (PlayerManagement.getLevel() == 7) { SceneManager.LoadScene("Ending"); } else if (PlayerManagement.getLevel() == 6) { PlayerManagement.increaseLevel(); SceneManager.LoadScene("BattleScene7"); } else if (PlayerManagement.getLevel() == 5) { PlayerManagement.increaseLevel(); SceneManager.LoadScene("BattleScene6"); } else if (PlayerManagement.getLevel() == 4) { PlayerManagement.increaseLevel(); SceneManager.LoadScene("BattleScene5"); } else if (PlayerManagement.getLevel() == 3) { PlayerManagement.increaseLevel(); SceneManager.LoadScene("BattleScene4"); } else if (PlayerManagement.getLevel() == 2) { PlayerManagement.increaseLevel(); SceneManager.LoadScene("BattleScene3"); } else if (PlayerManagement.getLevel() == 1) { PlayerManagement.increaseLevel(); SceneManager.LoadScene("BattleScene2"); } //SceneManager.LoadScene("Ending"); return; } PArea.ControlsON = false; otherPlayer.PArea.ControlsON = false; TurnManager.Instance.StopTheTimer(); new GameOverCommand(this).AddToQueue(); }
//Skrypt, który ponownie uruchamia scenę od nowa public void ReloadScene() { Debug.Log("Scene reloaded"); // Resetowanie ID wszystkich kart i bastionów IDFactory.ResetIDs(); //Wywołanie metody ResetIDs z klasy(skryptu) IDFactory IDHolder.ClearIDHoldersList(); //Wywołanie metody ClearIDHoldersList z klasy(skryptu) IDHolder Command.CommandQueue.Clear(); //Wywołanie pola CommandQueue z klasy Command i wyczyszczenie go (pozostawienie pustego pola) Command.CommandExecutionComplete(); //Wywołanie metody CommandExecutionComplete() z klasy Command //Załadowanie nowej sceny //Ładuje aktualnie aktywną scenę i pobiera jej nazwę SceneManager.LoadScene(SceneManager.GetActiveScene().name); }
/// <summary> /// Carga la escena de batalla. /// </summary> public void Jugar() { if (ControladorMenu.Instance.JugadorPuedeJugarBatalla()) { IDHolder.ClearIDHoldersList(); IDFactory.SaveCountMenu(); SceneManager.LoadScene("Batalla"); } else { MessageManager.Instance.ShowMessage("Tu mazo de batalla no contiene 8 cartas", 1.5f); } }
/// <summary> /// Resetea los valores y vuelve a la escena inventario mediante una escena de carga. /// </summary> public void ReloadScene() { // Command has some static members, so let`s make sure that there are no commands in the Queue Debug.Log("Scene reloaded"); // reset all card and creature IDs //TODO mirar si esto no afecta a las cartas e items del inventario IDFactory.ResetIDsBattle(); IDFactory.RecoverCountMenu(); IDHolder.ClearIDHoldersList(); Comandas.Instance.Clear(); Comandas.Instance.CompletarEjecucionComanda(); Controlador.Instance.Clear(); SceneManager.LoadSceneAsync("Loading"); }