// ------------------------------------- Saving ------------------------------------- public override void Save(string filename, string tag) { base.Save(filename, tag); ES2.Save(buildingType, filename + tag + "buildingType"); ES2.Save(buildingList.Count, filename + tag + "buildingListSize"); int counter = 0; foreach (Building building in buildingList) { building.Save(filename, tag + "building" + counter); counter++; } // don't forget entrances and exits foreach (Building building in entrances) { building.Save(filename, tag + "building" + counter); counter++; } // don't forget entrances and exits foreach (Building building in exits) { building.Save(filename, tag + "building" + counter); counter++; } }
/// <summary> /// Only sets the value /// </summary> void game_setHUD() { //disable if (toggleHud == 0) { HUD_text.text = "Off"; //removing HUD name so that it can't be disabled #if !EMM_ES2 PlayerPrefs.SetString("HUD_name", ""); #else ES2.Save("", "HUD_name"); #endif } //enable else { HUD_text.text = "On"; //saving HUD name so that it can be disabled #if !EMM_ES2 PlayerPrefs.SetString("HUD_name", HUD_name); #else ES2.Save("", "HUD_name"); #endif } }
public void SaveArrayList() { if (!isProxyValid()) { return; } string _tag = uniqueTag.Value; if (string.IsNullOrEmpty(_tag)) { _tag = Fsm.GameObjectName + "/" + Fsm.Name + "/arraylist/" + reference; } List <string> _list = new List <string>(); foreach (object item in proxy.arrayList) { _list.Add(PlayMakerUtils.ParseValueToString(item)); } ES2.Save <string>(_list, saveFile.Value + "?tag=" + uniqueTag); Log("Saved to " + saveFile.Value + "?tag=" + uniqueTag); Finish(); }
/// <summary> /// Saves all meetings to file /// </summary> public void SaveSchedule() { var schedule = new Schedule(meetings.ToArray()); var json = JsonUtility.ToJson(schedule); ES2.Save(json, FilePath); }
// using EasySave 2 plugin public static void Save() { #if UNITY_EDITOR //Debug.Log("SaveLoadSystem.SaveByES2()"); Debug.Log("SaveLoadSystem.Save()"); #endif #if UNITY_EDITOR Log.Info(encryptStr); #endif playerInfo = PlayerData.Instance.Player; string info = JsonUtility.ToJson(playerInfo); if (isSecure) { //ES2.Save(info, Application.persistentDataPath + "/userInfo.gd?encrypt=true&password=pass"); ES2.Save(info, GameConst.SAVE_PATH + encryptStr); } else { ES2.Save(info, GameConst.SAVE_PATH); } //if (GameManager.Instance.IsInternetConnected()) //{ // //TODO: Sync this save to server //} Debug.Log("Save Done"); }
public void send_voice() { https.GetComponent <https>().Send_voice(); //조건 (보이스보유). //결과. reset(); panel1.SetActive(false); panel2.SetActive(false); if (Application.loadedLevelName == "1.Game") { //gameManager.GetComponent<GameManager>().soundManagerOn(); GetComponent <AudioSource>().enabled = true; GameManager.talkCheck = false; } if (Application.loadedLevelName == "0.Main") { webViewManager.GetComponent <WebViewScript>().OnWebView(); GetComponent <AudioSource>().enabled = true; } ES2.Save <int>(ES2.Load <int>("voice") - 1, "voice"); gameManager.GetComponent <GameManager>().ItemTxt(); }
void Save() { if (myGameObject == null) { Debug.Log("I don't know why " + gameObject.name + " has a null reference to self...but it needs to be fixed"); myGameObject = this.gameObject; } string savePath = GOD_Memory.rootFolder + "laminaBrain"; GOD_Memory.instance.CheckPath(savePath); savePath += "?tag=" + myGameObject.name; //save base stats ES2.Save <float>(baseStats.maxHealth, savePath + "maxhealth"); ES2.Save <float>(baseStats.health, savePath + "health"); ES2.Save <int>(baseStats.strength, savePath + "strength"); ES2.Save <int>(baseStats.speed, savePath + "speed"); //save level info ES2.Save <int>(myLevelInfo.level, savePath + "level"); ES2.Save <int>(myLevelInfo.experience, savePath + "experience"); ES2.Save <int>(myLevelInfo.experienceTilNxtLvl, savePath + "experienceTilNxtLvl"); }
public void SaveHashTable() { if (!isProxyValid()) { return; } string _tag = uniqueTag.Value; if (string.IsNullOrEmpty(_tag)) { _tag = Fsm.GameObjectName + "/" + Fsm.Name + "/hashTable/" + reference; } Dictionary <string, string> _dict = new Dictionary <string, string>(); foreach (object key in proxy.hashTable.Keys) { _dict[(string)key] = PlayMakerUtils.ParseValueToString(proxy.hashTable[key]); } ES2.Save(_dict, saveFile.Value + "?tag=" + _tag); Log("Saved to " + saveFile.Value + "?tag=" + _tag); Finish(); }
public static void SaveAllMainMenu() { if (SceneManager.GetActiveScene().name == "MainMenu") { ES2.Save(StaticContainer.username, "savas.txt?tag=username"); } }
public void setBlue() { animator.runtimeAnimatorController = blue; //Set all others to false isYellow = false; isBlue = true; isRed = false; isGreen = false; isElectro = false; isMarble = false; blueNumber++; Analytics.CustomEvent("Blue", new Dictionary <string, object> { { "How many times blue has been selected", blueNumber } }); //Save Colour ES2.Save(isYellow = false, "savefile.txt?tag=isYellow"); ES2.Save(isBlue = true, "savefile.txt?tag=isBlue"); ES2.Save(isRed = false, "savefile.txt?tag=isRed"); ES2.Save(isGreen = false, "savefile.txt?tag=isGreen"); ES2.Save(isElectro = false, "savefile.txt?tag=isElectro"); ES2.Save(isMarble = false, "savefile.txt?tag=isMarble"); //UI off setPlayer.SetActive(false); button.SetActive(true); jumpHard.enabled = true; touchStart.SetActive(true); }
public static bool Save(Company company, string gameID) { string filename = CompanyManager.GetFilename(gameID) + "?tag=" + company.id; ES2.Save(company, filename); return(true); }
public static bool CheckGlobalData() { if (ES2.Exists("chui/GlobalData")) { Debug.Log("GlobalData found!"); //input global data to Globaldata object GlobalData.accountCreatedTime = ES2.Load <string>("chui/GlobalData?tag=accountCreatedTime"); GlobalData.playCreateCount = ES2.Load <int>("chui/GlobalData?tag=playCreateCount"); GlobalData.playWeekCount = ES2.Load <int>("chui/GlobalData?tag=playWeekCount"); GlobalData.playEndingCount = ES2.Load <int>("chui/GlobalData?tag=playEndingCount"); //GlobalData.sound = ES2.Load<int>("chui/GlobalData?tag=sound"); //GlobalData.characterDataList = JsonUtility.FromJson<List<CharacterData>> (ES2.Load<string> ("chui/GlobalData?tag=characterDataList")); return(true); } else { Debug.Log("Create New Data!"); ES2.Save(DateTime.Now.ToString("yyyyMMddHHmmss"), "chui/GlobalData?tag=accountCreatedTime&encrypt=true"); ES2.Save(0, "chui/GlobalData?tag=playCreateCount&encrypt=true"); ES2.Save(0, "chui/GlobalData?tag=playWeekCount&encrypt=true"); ES2.Save(0, "chui/GlobalData?tag=playEndingCount&encrypt=true"); ES2.Save("{}", "chui/GlobalData?tag=characterDataList&encrypt=true"); //ES2.Save(1, "chui/GlobalData?tag=sound&encrypt=true"); //create static global ojbect & init return(false); } }
private IEnumerator LoadFromWeb() { if (ES2.Exists("myFile.txt?tag=mySprite" + logoString)) { mySprite = ES2.Load <Sprite>("myFile.txt?tag=mySprite" + logoString); logo.sprite = mySprite; } else { WWW imageURLWWW = new WWW(logoString); while (!imageURLWWW.isDone) { yield return(new WaitForSeconds(0.01f)); } if (imageURLWWW.texture != null) { Sprite sprite = new Sprite(); logo.gameObject.transform.rotation = Quaternion.identity; sprite = Sprite.Create(imageURLWWW.texture, new Rect(0, 0, 128, 128), Vector2.zero); mySprite = sprite; logo.sprite = mySprite; //ES2.Save(link, "link" + imagen); ES2.Save(mySprite, "myFile.txt?tag=mySprite" + logoString); } } yield return(null); }
/* * Saves an Object * 'i' is the number of the object we are saving. */ private void SaveObject(GameObject obj, int i, string file) { // Let's get the UniqueID object, as we'll need this. UniqueID uID = obj.GetComponent <UniqueID>(); //Note that we're appending the 'i' to the end of the path so that //we know which object each piece of data belongs to. ES2.Save(uID.id, file + "?tag=uniqueID" + i); ES2.Save(uID.prefabName, file + "?tag=prefabName" + i); // You could add many more components here, inlcuding custom components. // For simplicity, we're only going to save the Transform component. Transform t = obj.GetComponent <Transform>(); if (t != null) { ES2.Save(t, file + "?tag=transform" + i); // We'll also save the UniqueID of the parent object here, or -1 // string if it doesn't have a parent. UniqueID parentuID = UniqueID.FindUniqueID(t.parent); if (parentuID == null) { ES2.Save(-1, file + "?tag=parentID" + i); } else { ES2.Save(parentuID.id, file + "?tag=parentID" + i); } } }
void saveData() { #if PIXELCRUSHERS_SAVESYSTEM PixelCrushers.SaveSystem.SaveToSlot(slotId); #endif //set data in UI saveName_text.text = saveName; savePercentage_text.text = savePercentage + "%"; //transform as well //saving #if !EMM_ES2 PlayerPrefs.SetInt("slot_" + slotId, slotId); PlayerPrefs.SetString("slot_saveName_" + slotId, saveName); PlayerPrefs.SetFloat("slot_savePercentage_" + slotId, savePercentage); PlayerPrefs.SetInt("saveTriggerId_" + slotId, saveTriggerId); PlayerPrefs.SetString("slot_sceneName_" + slotId, sceneName); #else ES2.Save(slotId, "slot_" + slotId); ES2.Save(saveName, "slot_saveName_" + slotId); ES2.Save(savePercentage, "slot_savePercentage_" + slotId); ES2.Save(saveTriggerId, "saveTriggerId_" + slotId); ES2.Save(sceneName, "slot_sceneName_" + slotId); #endif }
public void LoadSceneSaved() { //if there's a save game present at this slot if (sceneToLoad != "") { Time.timeScale = 1; //delete player GameObject player = GameObject.FindGameObjectWithTag("Player"); if (player) { Destroy(player); } #if !EMM_ES2 //save which slot is loaded PlayerPrefs.SetInt("slotLoaded_", slotId); //loads a specific scene PlayerPrefs.SetString("sceneToLoad", sceneToLoad); #else //save which slot is loaded ES2.Save(slotId, "slotLoaded_"); //loads a specific scene ES2.Save(sceneToLoad, "sceneToLoad"); #endif //load level via fader Fader fader = FindObjectOfType <Fader>(); fader.FadeIntoLevel("LoadingScreen"); } }
void SaveData_quickSlot() { //set data in UI QsaveName_text.text = "Quicksave : " + SceneManager.GetActiveScene().name; QsavePercentage_text.text = ""; #if PIXELCRUSHERS_SAVESYSTEM PixelCrushers.SaveSystem.SaveToSlot(QslotId); #endif //saving #if !EMM_ES2 PlayerPrefs.SetInt("QuickSaveDataIsPresent", 1); PlayerPrefs.SetInt("slot_" + QslotId, QslotId); PlayerPrefs.SetString("slot_saveName_" + QslotId, QsaveName_text.text); PlayerPrefs.SetString("slot_sceneName_" + QslotId, SceneManager.GetActiveScene().name); #else ES2.Save(1, "QuickSaveDataIsPresent"); ES2.Save(QslotId, "slot_" + QslotId); ES2.Save(QsaveName_text.text, "slot_saveName_" + QslotId); ES2.Save(SceneManager.GetActiveScene().name, "slot_sceneName_" + QslotId); #endif SavePositions(); //play HUD animation Animator SaveText = GameObject.Find("SaveText").GetComponent <Animator>(); if (!SaveText.IsInTransition(0)) { SaveText.Play("SaveTextHUD"); } }
/// <summary> /// Toggle AnisoFiltering /// </summary> public void gfx_AnisoFiltering() { //disable if (toggleAnisoFilt == 0) { toggleAnisoFilt = 1; AnisoFiltering_text.text = "On"; } //enable else { toggleAnisoFilt = 0; AnisoFiltering_text.text = "Off"; } //setting value QualitySettings.anisotropicFiltering = toggleAnisoFilt == 1 ? AnisotropicFiltering.Enable : AnisotropicFiltering.Disable; //override new setting #if !EMM_ES2 PlayerPrefs.SetInt("toggleAnisoFilt", toggleAnisoFilt); #else ES2.Save(toggleAnisoFilt, "toggleAnisoFilt"); #endif //play click sound EasyAudioUtility.instance.Play("Hover"); }
private void OnTriggerEnter(Collider other) { if (other.gameObject.tag == "Player") { if (ES2.Exists("SEngager")) { this.boutonJouer.SetActive(true); } ES2.Save(player.transform.position, "position"); ES2.Save(this.ZoneSpawn.GetComponent <LifeScript>().Score, "score"); //TODO - Calcul du temps ES2.Save(this.MainCamera.GetComponent <Timer>().minutes, "minutes"); ES2.Save(this.MainCamera.GetComponent <Timer>().secondes, "secondes"); //float temps = ES2.Load<int>("minutes") + ES2.Load<int>("secondes"); //ES2.Save(temps, "temps"); ES2.Save(SceneManager.GetActiveScene().name, "savedScene"); //Si pas début de jeu = pas de panel explicatif à afficher this.marqueur += 1; ES2.Save(this.marqueur, "marqueur"); } }
/// <summary> /// Toggle vSync /// </summary> public void gfx_Vsync() { if (toggleVsync == 0) { QualitySettings.vSyncCount = 1; toggleVsync = 1; toggleVsync_text.text = "On"; } else { QualitySettings.vSyncCount = 0; toggleVsync = 0; toggleVsync_text.text = "Off"; } //override new setting #if !EMM_ES2 PlayerPrefs.SetInt("toggleVsync", toggleVsync); #else ES2.Save(toggleVsync, "toggleVsync"); #endif //play click sound EasyAudioUtility.instance.Play("Hover"); }
public bool CheckSameDayLogin(string last, int RenzokuLogin) { DateTime lastTime = PSGameUtils.StringToDateTime(last); SetMonths(); if (PSGameUtils.IsSameDayLogin(lastTime)) { Debug.Log("TimeManager 同じ日"); isSameDayLogin = true; } else { DataManger.Instance.GAMEDATA.earnedLoginBonus = false; isSameDayLogin = false; if (PSGameUtils.IsRenzoku(lastTime)) { RenzokuLogin++; DataManger.Instance.GAMEDATA.RenzokuLogin = RenzokuLogin; Debug.Log("TimeManager 違う日 連続" + DataManger.Instance.GAMEDATA.RenzokuLogin); ES2.Save(DataManger.Instance.GAMEDATA.RenzokuLogin, DataManger.DataFilename + "?tag=RenzokuLogin"); } else { Debug.Log("TimeManager 違う日 連続ブレイク"); RenzokuLogin = 0; DataManger.Instance.GAMEDATA.RenzokuLogin = RenzokuLogin; } DataManger.Instance.GAMEDATA.earnedLoginBonus = false; ES2.Save(DataManger.Instance.GAMEDATA.earnedLoginBonus, DataManger.DataFilename + "?tag=earnedLoginBonus"); DataManger.Instance.SaveCurrentTime("?tag=lastLoginTime"); } UpdateTime(); return(isSameDayLogin); }
/// <summary> /// Toggle Shadows /// </summary> public void gfx_shadows() { //disable shadows if (toggleShadows == 0) { QualitySettings.shadows = ShadowQuality.HardOnly; toggleShadows = 1; toggleShadows_text.text = "Hard"; } //Hard shadows else if (toggleShadows == 1) { QualitySettings.shadows = ShadowQuality.All; toggleShadows = 2; toggleShadows_text.text = "Soft"; } //Soft shadows else if (toggleShadows == 2) { QualitySettings.shadows = ShadowQuality.Disable; toggleShadows = 0; toggleShadows_text.text = "Off"; } //override new setting #if !EMM_ES2 PlayerPrefs.SetInt("toggleShadows", toggleShadows); #else ES2.Save(toggleShadows, "toggleShadows"); #endif //play click sound EasyAudioUtility.instance.Play("Hover"); }
// ------------------------------------- Saving ------------------------------------- public static void Save(string filename, string tag) { ES2.Save(seconds, filename + tag + "TimeController" + "seconds"); ES2.Save(minutes, filename + tag + "TimeController" + "minutes"); ES2.Save(hours, filename + tag + "TimeController" + "hours"); ES2.Save(days, filename + tag + "TimeController" + "days"); }
/// <summary> /// Toggle Different Texture Resolutions /// </summary> public void gfx_textureQuality() { //0 = full //1 = half //2 = quarter if (toggleTextureQuality == 0) { QualitySettings.masterTextureLimit = 1; toggleTextureQuality_text.text = "Half"; toggleTextureQuality = 1; } else if (toggleTextureQuality == 1) { QualitySettings.masterTextureLimit = 2; toggleTextureQuality_text.text = "Quarter"; toggleTextureQuality = 2; } else if (toggleTextureQuality == 2) { QualitySettings.masterTextureLimit = 0; toggleTextureQuality_text.text = "Full"; toggleTextureQuality = 0; } //override new setting #if !EMM_ES2 PlayerPrefs.SetInt("toggleTextureQuality", toggleTextureQuality); #else ES2.Save(toggleTextureQuality, "toggleTextureQuality"); #endif //play click sound EasyAudioUtility.instance.Play("Hover"); }
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 }
/// <summary> /// Scroll through various screen resolutions /// </summary> public void gfx_ScreenResolution() { //if the count is less, it means we can increase more resolution if (currentScreenResolutionCount < allScreenResolutions.Length) { Screen.SetResolution(allScreenResolutions[currentScreenResolutionCount].width, allScreenResolutions[currentScreenResolutionCount].height, toggleFullscreen == 1 ? true : false); //increment so that we increase it next time currentScreenResolutionCount++; } else { //start the count from zero currentScreenResolutionCount = 0; Screen.SetResolution(allScreenResolutions[currentScreenResolutionCount].width, allScreenResolutions[currentScreenResolutionCount].height, toggleFullscreen == 1 ? true : false); } //set text finally currentScreenResolution_text.text = Screen.currentResolution.width + " x " + Screen.currentResolution.height; //save finally #if !EMM_ES2 PlayerPrefs.SetInt("currentScreenResolutionCount", currentScreenResolutionCount); #else ES2.Save(currentScreenResolutionCount, "currentScreenResolutionCount"); #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"); } }
/// <summary> /// Toggle Fullscreen /// </summary> public void gfx_fullScreen() { //perform toggle if (toggleFullscreen == 0) { toggleFullscreen = 1; toggleFullscreen_text.text = "Yes"; } else { toggleFullscreen = 0; toggleFullscreen_text.text = "No"; } //set values Screen.SetResolution(Screen.width, Screen.height, toggleFullscreen == 1 ? true : false); //override new setting #if !EMM_ES2 PlayerPrefs.SetInt("toggleFullscreen", toggleFullscreen); #else ES2.Save(toggleFullscreen, "toggleFullscreen"); #endif //play click sound EasyAudioUtility.instance.Play("Hover"); }
public void SaveAllModelsToPref1() { for (int i = 0; i < modelsCount; i++) { ES2.Save(allModels[i], "model" + i); } }
public static bool Save(Wrestler wrestler, string gameID) { string filename = WrestlerManager.GetFilename(gameID) + "?tag=" + wrestler.id; ES2.Save(wrestler, filename); return(true); }