public void EraseGame() { if (ES2.Exists(rootFolder)) { ES2.Delete(rootFolder); } }
private void DisplayFileSpecificMenu() { EditorGUILayout.BeginHorizontal(); if (GUILayout.Button("Delete File", EditorStyles.toolbarButton)) { if (EditorUtility.DisplayDialog("Delete this File?", "Are you sure you want to permanently delete this file?", "Delete File", "Cancel")) { ES2.Delete(currentFilePath); Reset(); } } string showFileText = "Show in Explorer"; if (OSFileBrowser.IsInMacOS) { showFileText = "Show in Finder"; } if (GUILayout.Button(showFileText, EditorStyles.toolbarButton)) { ES2EditorTools.ShowInFileBrowser(currentFilePath); } if (GUILayout.Button("Refresh File", EditorStyles.toolbarButton)) { OpenFile(); } EditorGUILayout.EndHorizontal(); }
// Use this for initialization void Start() { if (ES2.Exists("highScore")) { ES2.Delete("highScore"); } }
private void Awake() { if (instance != null) { Destroy(gameObject); return; } else { instance = this; DontDestroyOnLoad(gameObject); } if (isTest) { ES2.Delete(SaveSystem.STAGE); ES2.Delete(SaveSystem.SKIN); } SkinSystem.Init(); ConfigSystem.Init(); SaveSystem.Init(); EventSystem.Init(); SetGrabvity(); //Screen.SetResolution(540, 960, false); }
public void newGame() { //if we don't have this component if (!GetComponent <LevelSelectManager>()) { //loads a specific scene #if !EMM_ES2 PlayerPrefs.SetString("sceneToLoad", newGameSceneName); #else ES2.Save(newGameSceneName, "sceneToLoad"); #endif //load level via fader Fader fader = FindObjectOfType <Fader>(); fader.FadeIntoLevel("LoadingScreen"); } //open the level select screen else { GetComponent <LevelSelectManager>().openLevelSelect(); } //delete slot id #if !EMM_ES2 PlayerPrefs.DeleteKey("slotLoaded_"); #else ES2.Delete("slotLoaded_"); #endif }
public void OverWriteSave() { DataManager DM = GameObject.FindObjectOfType <DataManager>(); DM.Name = Name.text; DM.hasName = true; if (ES2.Exists("InputName")) { ES2.Save(DM.Name, "InputName"); } if (ES2.Exists("hasName")) { ES2.Save(DM.hasName, "hasName"); } if (ES2.Exists("U2")) { ES2.Delete("U2"); } if (ES2.Exists("U3")) { ES2.Delete("U3"); } if (ES2.Exists("U4")) { ES2.Delete("U4"); } if (ES2.Exists("U5")) { ES2.Delete("U5"); } if (ES2.Exists("U6")) { ES2.Delete("U6"); } if (ES2.Exists("H1")) { ES2.Delete("H1"); } if (ES2.Exists("H2")) { ES2.Delete("H2"); } if (ES2.Exists("H3")) { ES2.Delete("H3"); } if (ES2.Exists("H4")) { ES2.Delete("H4"); } if (ES2.Exists("H5")) { ES2.Delete("H5"); } if (ES2.Exists("H6")) { ES2.Delete("H6"); } }
public static void ClearDefaultSaveFolder() { if (EditorUtility.DisplayDialog("Clear Default Save Folder?", "Are you sure you want to clear the Default Save Folder?\n\nThis will delete everything stored in:\n" + Application.persistentDataPath, "Clear Default Save Folder", "Cancel")) { ES2.Delete(Application.persistentDataPath + "/"); } }
public static void saveToFile <E>(E progress, string fileName, int id, int worldId) { ES2.Delete(MasterDataManagerBase.getLoadPass(id, worldId, fileName)); ES2Writer writer = ES2Writer.Create(MasterDataManagerBase.getLoadPassExceptTag(fileName)); writer.Write <E>(progress, worldId + "" + id); writer.Save(); }
/// <summary> /// セーブデータをデリートします /// </summary> /// <param name="name">デリートしたいセーブデータの名前</param> public static void delete(string name) { if (!ES2.Exists(FILE_NAME + ".txt?tag=" + name)) { return; } ES2.Delete(FILE_NAME + ".txt?tag=" + name); }
void delete() { //On supprime les sauvegardes de la partie précédente if (ES2.Exists("position")) { ES2.Delete("position"); } if (ES2.Exists("rotation")) { ES2.Delete("rotation"); } if (ES2.Exists("savedScene")) { ES2.Delete("savedScene"); } if (ES2.Exists("score")) { ES2.Delete("score"); } if (ES2.Exists("temps")) { ES2.Delete("temps"); } if (ES2.Exists("bool")) { ES2.Delete("bool"); } if (ES2.Exists("trouve")) { ES2.Delete("trouve"); } if (ES2.Exists("code")) { ES2.Delete("code"); } sceneCount = UnityEngine.SceneManagement.SceneManager.sceneCountInBuildSettings; for (int i = 1; i < sceneCount; i++) { if (ES2.Exists("scene" + i)) { ES2.Delete("scene" + i); } if (ES2.Exists("sceneACharger" + i)) { ES2.Delete("sceneACharger" + i); } } }
public bool ResetCharacterData() { if (ES2.Exists("chui/CharacterData")) { Debug.Log("CharacterData found! This data will delete"); ES2.Delete("chui/CharacterData"); } return(true); }
public void DeleteWatchCount(int id) { string tag = GetWatchCountTag(id); if (ES2.Exists(tag)) { ES2.Delete(tag); } }
public bool ResetGlobalData() { if (ES2.Exists("chui/GlobalData")) { Debug.Log("GlobalData found! This data will delete"); ES2.Delete("chui/GlobalData"); } return(true); }
/// <summary> /// This could be optimized by splitting it into multiple functions that only grab and save /// data for particular things. It could even be saved as separate files -- "PVEnemyState", etc. /// But let's see how slow it is first. /// </summary> public static void Save() { ES2.Delete("PVState"); if (!MainMenu.InGame | Tutorial.TutorialLevel != 0) { return; } SavedState ss = new SavedState(); ss.Level = GameControl.Level; ss.ObstacleLevelType = ObstacleLibrary.CurrentLevelType; ss.ObstacleXPositions = ObstacleXPositions; ss.ObstacleYPositions = ObstacleYPositions; foreach (GameObject cardGO in gameControl.Hand) { ss.CardsInHand.Add(cardGO.GetComponent <Card>().ThisLibraryCard); } ss.CardsInDeck = gameControl.Deck; foreach (GameObject cardGO in gameControl.Discard) { ss.CardsInDiscard.Add(cardGO.GetComponent <Card>().ThisLibraryCard); } foreach (GameObject enemyGO in gameControl.EnemyObjs) { Enemy thisEnemy = enemyGO.GetComponent <Enemy>(); ss.Enemies.Add(thisEnemy.ThisEnemyLibraryCard.Name); ss.EnemyHealths.Add(thisEnemy.CurrentHealth); ss.EnemyPlays.Add(thisEnemy.CurrentPlays); GridUnit enemyGU = enemyGO.GetComponent <GridUnit>(); ss.EnemyXPositions.Add(enemyGU.xPosition); ss.EnemyYPositions.Add(enemyGU.yPosition); } ss.PlayerPosition = new int[] { player.playerGU.xPosition, player.playerGU.yPosition }; ss.PlayerHealth = player.currentHealth; ss.PlayerMoves = gameControl.MovesLeft; ss.PlayerPlays = gameControl.PlaysLeft; ss.Dollars = gameControl.Dollars; ss.BleedingTurns = gameControl.BleedingTurns; ss.SwollenTurns = gameControl.SwollenTurns; ss.HungerTurns = gameControl.HungerTurns; ss.TriggerList = TriggerList; ss.Goals = shopControl.Goals; ss.ShopMode = ShopMode; if (ShopMode) { ss.ShopCardList1 = shopControl.CardsToBuyFrom[0]; ss.ShopCardList2 = shopControl.CardsToBuyFrom[1]; ss.ShopCardList3 = shopControl.CardsToBuyFrom[2]; } ES2.Save <SavedState>(ss, "PVState"); }
// Start is called before the first frame update void Start() { if (ES2.Load <bool>("jeuLance") == true & ES2.Load <int>("marqueur") == 1) { if (ES2.Exists("position")) { ES2.Delete("position"); } if (ES2.Exists("minutes")) { ES2.Delete("minutes"); } if (ES2.Exists("savedScene")) { ES2.Delete("savedScene"); } if (ES2.Exists("score")) { ES2.Delete("score"); } if (ES2.Exists("secondes")) { ES2.Delete("secondes"); } if (ES2.Exists("Hermes")) { ES2.Delete("Hermes"); } if (ES2.Exists("Valorissimo")) { ES2.Delete("Valorissimo"); } if (ES2.Exists("SEngager")) { ES2.Delete("SEngager"); } this.marqueur += 1; ES2.Save(this.marqueur, "marqueur"); } else { this.CanevasDebut.SetActive(false); this.CanevasChoix.SetActive(false); } Load(); }
public void Delete(string file = null) { if (file != null) { this.file = file; } if (ES2.Exists(this.file)) { ES2.Delete(this.file); } }
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public static bool DeleteTag(string filename, string tag = "") { if (ES2.Exists(filename + ".bytes")) { ES2.Delete(filename + ".bytes" + "?tag=" + tag); return(true); } else { return(false); } }
public void DeleteAllSaved() { while (GetSavedGames().Count > 0) { SavedGame game = GetSavedGames()[0]; DeleteSaved(game); } if (ES2.Exists(SavedGameFilename)) { ES2.Delete(SavedGameFilename); } }
public void CheckPath(string path) { if (pathList.Contains(path))//we only want to handle each path once { return; } pathList.Add(path); if (ES2.Exists(path)) { ES2.Delete(path); } }
public static void DeleteSaved(string gameID) { string companyLocation = CompanyManager.GetFilename(gameID); if (ES2.Exists(companyLocation)) { ES2.Delete(companyLocation); } if (SavedGameManager.Instance.IsGameLoaded() && CompanyManager.Instance != null && gameID == SavedGameManager.Instance.CurrentGameID) { CompanyManager.Instance.DestroyCurrentGameObjects(); } }
public static void DeleteSaved(string gameID) { string filename = VenueManager.GetFilename(gameID); if (ES2.Exists(filename)) { ES2.Delete(filename); } if (VenueManager.Instance != null && SavedGameManager.Instance.IsGameLoaded() && gameID == SavedGameManager.Instance.CurrentGameID) { VenueManager.Instance.DestroyCurrentGameObjects(); } }
private void DeleteCurrentTag() { ES2.Delete(currentFilePath + "?tag=" + currentTag); ArrayUtility.Remove(ref tags, currentTag); headers.Remove(currentTag); currentTag = null; currentIndex = -1; // Close file if no tags left in file. if (tags.Length == 0) { Reset(); } }
public static bool DeleteSaved(string id, string gameID) { string filename = CompanyManager.GetFilename(gameID) + "?tag=" + id; if (ES2.Exists(filename)) { ES2.Delete(filename); return(true); } else { Debug.LogError(string.Format("Unable to delete company at {0}: No such file found", filename)); return(false); } }
/// <summary> /// Check for database upgrades. /// </summary> /// <param name="Clear">Empty the database of data.</param> public override void ValidateDatabase(bool Clear) { Start(); if (Clear) { ES2.Delete(localDB); } if (!ES2.Exists(localDB)) { using (ES2Writer writer = ES2Writer.Create(localDB)) { writer.Write("1.0", "version"); writer.Save(); } } } // check for database upgrades
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public static bool DeleteFile(string filename) { if (ES2.Exists(filename + ".bytes")) { ES2.Delete(filename + ".bytes"); #if UNITY_EDITOR AssetDatabase.Refresh(); #endif return(true); } else { return(false); } }
void RetrieveSceneToLoad() { //if using Easy Save, //Integration will be done automatically #if !EMM_ES2 //retrieve what scene to be loaded sceneToLoad = PlayerPrefs.GetString("sceneToLoad"); //if it's null if (sceneToLoad == "") { sceneToLoad = "MainMenu"; } #else if (ES2.Exists("sceneToLoad")) { string sceneNameToBeLoaded = ES2.Load <string>("sceneToLoad"); Debug.Log(sceneNameToBeLoaded); if (!string.IsNullOrEmpty(sceneNameToBeLoaded)) { sceneToLoad = sceneNameToBeLoaded; } else { sceneToLoad = "MainMenu"; } } else { //the scene to load data haven't been generated even once... sceneToLoad = "MainMenu"; } #endif //delete key asap #if !EMM_ES2 PlayerPrefs.DeleteKey("sceneToLoad"); #else ES2.Delete("sceneToLoad"); #endif }
private void CheckIfSaving() { if (created) { if (stateList != null) { foreach (var VARIABLE in stateList) { if (VARIABLE.Active) { if (ES2.Exists("items.txt") && !itemsTxtDeleted) { ES2.Delete("items.txt"); ModConsole.Print("items.txt Deleted!"); itemsTxtDeleted = true; } } } } } }
/* * Creates a button which allows us to delete data or spawn a random prefab. */ void OnGUI() { // Button to create random prefab. if (GUI.Button(new Rect(buttonPositionX, 0, 250, 100), "Create Random " + prefab.name)) { CreateRandomPrefab(); } // Button to delete all data. if (GUI.Button(new Rect(buttonPositionX, 100, 250, 100), "Delete Saved " + prefab.name)) { // Delete entire file. ES2.Delete(filename); // Destroy each created prefab, then clear the List. for (int i = 0; i < createdPrefabs.Count; i++) { Destroy(createdPrefabs[i]); } createdPrefabs.Clear(); } }
// delete private void DeleteVideoFile(int id) { DeleteWatchCount(id); ES2.Delete(GetVideoPath(id)); }
public void Delete() { ES2.Delete(file); }