public override void OnInspectorGUI() { DrawDefaultInspector(); MapCampaign _target = (MapCampaign)target; if (GUILayout.Button("Delete")) { MapCampaign.DeleteFile(); } if (GUILayout.Button("Save")) { _target.SaveFile(); } if (GUILayout.Button("Update Nodes")) { _target.FindNodes(); _target.UpdateNodes(); _target.FindArmies(); } //if (GUILayout.Button("Find Nodes")) //{ // _target.FindNodes(); //} //if (GUILayout.Button("Find Armies")) //{ // _target.FindArmies(); //} }
void UpdateCampaignFile() { Assert.IsTrue(GameSettings.INSTANCE.prevSceneIdx != -1); nextLevel = GameSettings.INSTANCE.prevSceneIdx; // update decks Deck[] decks = FindObjectsOfType <Deck>(); CardTypeCount[] attacker_deck = null; CardTypeCount[] defender_deck = null; Assert.IsTrue(decks.Length == 2); for (int i = 0; i < decks.Length; ++i) { Deck d = decks[i]; if (d.team == TeamType.Player) { attacker_deck = d.GetDeck(); } else { defender_deck = d.GetDeck(); } } // update GameSettings GameSettings.INSTANCE.SetAttackDeck(attacker_deck); GameSettings.INSTANCE.SetTargetDeck(defender_deck); // update file MapCampaign.UpdateDecksInFile(attacker_deck, defender_deck); }
public void ReplayCampaign() { MapCampaign.DeleteFile(); GameSettings.INSTANCE.ResetBattle(); Time.timeScale = 1.0f; SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex); }
public void LoadMainMenu() { MapCampaign map = GetComponent <MapCampaign>(); map.SaveFile(); // erase attack data from GameSettings GameSettings.INSTANCE.ResetBattle(); Time.timeScale = 1.0f; SceneManager.LoadScene("Scenes/MainMenu"); }
public void EndCampaign() { LoadMainMenu(); MapCampaign.DeleteFile(); }