public void NewPlace(PlaceGroup place, bool clickedOnMap = false) { // Save places if (savePlacesAfterReload) { savePlacesAfterReload = false; PlacesSave.Save(); } bool wait = true; if (TopBar.instance.currentTab == 2) { animator.SetTrigger("Change"); } else { wait = false; TopBar.instance.SwitchTab(2); } StopAllCoroutines(); if (!clickedOnMap) { RenderMap.instance.UpdateMapSize(0.3f); GlobalVariables.inst.MoveCamera(place.mapObject.gameObject.transform.position); place.mapObject.Select(); } this.place = place; StartCoroutine(AfterAnimationChange(wait)); }
public static void Load() { string destination = Application.persistentDataPath + "/save2.dat"; FileStream file; if (File.Exists(destination)) { file = File.OpenRead(destination); } else { Debug.LogError("File not found"); return; } BinaryFormatter bf = new BinaryFormatter(); SaveData data = (SaveData)bf.Deserialize(file); file.Close(); PlacesSave.LoadCategories(data.placesSave); ReadJson.instance.uploadedFiles = data.uploadedFiles; ReadJson.instance.days = data.loadedJson; if (data.placesAddressSave != null) { GoogleLocationApi.instance.placesAddressSave = data.placesAddressSave; } }
void Start() { PlacesSave.Load(); OpenFileDialog(); if (uploadedFiles.Count > 0) { filesBox.SetupTexts(uploadedFiles); CheckIfCanDraw(); } }
public void IconClicked(int id) { ChangeSelectedIcon(id); place.RefreshIcons(id); if (placeIcon != null) { placeIcon.sprite = PlacesRanking.instance.categories[place.icon].smallIcon; } PlacesSave.IconChange(place.placeInfo.id, id); }
// Loading files static void LoadPlaces() { if (File.Exists(placesFileName)) { StreamReader sr = new StreamReader(placesFileName); string line = sr.ReadLine(); sr.Close(); PlacesSave save = JsonConvert.DeserializeObject <PlacesSave>(line); places = save.places; currentId = save.currentId; } }
public void RestartFiles() { days.Clear(); RenderMap.instance.Clear(); PlacesRanking.instance.Clear(); dayNumber = 0; uploadedFiles.Clear(); FilesBox.instance.SetupTexts(uploadedFiles); SaveSystem.Save(); PlacesSave.Clear(); blankPlaceholder.SetActive(true); dateTimeArrows.SetActive(false); TopBar.instance.Clear(); }
void LoadIcon(MovesJson.SegmentsInfo.PlaceInfo place, Action <int> action) { PlaceType placeType = place.type; if (placeType == PlaceType.home) { action.Invoke(4); } else if (placeType == PlaceType.school) { action.Invoke(9); } else { action.Invoke(6); } int?customIcon = PlacesSave.FindIcon(place.id); if (customIcon != null) { action.Invoke(customIcon.Value); } }