public void ReloadScene() { IDFactory.ResetIDs(); IDHolder.ClearIDHoldersList(); Command.OnSceneReload(); SceneManager.LoadScene(SceneManager.GetActiveScene().name); }
public void ReloadScene() { Debug.Log("Scene reloaded"); IDFactory.ResetIDs(); IDHolder.ClearIDHoldersList(); Command.CommandQueue.Clear(); Command.CommandExecutionComplete(); SceneManager.LoadScene(SceneManager.GetActiveScene().name); }
public void StartGame() { //reset all card IDs IDFactory.ResetIDs(); IDHolder.ClearIDHoldersList(); Command.OnSceneReload(); SceneManager.LoadScene("InGame"); }
void InitializeGame() { Debug.Log("GameManger INITIALIZATION"); gameRunning = true; IDFactory.ResetIDs(); playerNorth = new PlayerModel(0, "Cooper", Faction.Ottoman, Position.North); playerSouth = new PlayerModel(1, "Johnson", Faction.Ottoman, Position.South); resourcesNorth.GetComponent <ResourcePool>().updateResourcesView(playerNorth.resourcesCurrent, playerNorth.resourcesMaxThisTurn); resourcesSouth.GetComponent <ResourcePool>().updateResourcesView(playerSouth.resourcesCurrent, playerSouth.resourcesMaxThisTurn); }
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); }
public void ResetDeck() { cards = new List <CardAsset>(); IDFactory.ResetIDs(); foreach (var ca in cardCollection.cards) { for (int i = 0; i < ca.NumberInDeck; i++) { CardAsset card = Object.Instantiate(ca); card.Id = IDFactory.GetUniqueID(); cards.Add(card); } } cards.Shuffle(); }