private void RestoreState() { logger.Debug("Restoring state"); if (IOUtils.ExistsPersitentData()) { SaveState save = IOUtils.LoadData(); logger.Debug("Restored state: " + JsonUtility.ToJson(save)); switch (save.state) { case State.LOCATION_STARTED: targetList = save.targetList; currentState = save.state; activeMmos = save.activeMmos; Invoke("RestoreChoice", 0.5f); // Restart location service // Run is-close check WatchAll(); break; case State.LOCATION_FOUND: case State.DISPLAYING: active = save.active; // Restart display service break; } } if (IOUtils.ExistsHeadingFile()) { headingDictionary = IOUtils.LoadHeadings(); Debug.Log("Loaded headings:\n" + JsonUtility.ToJson(headingDictionary)); } }
private void RestartLocationServices(bool native = true, bool unity = true) { logger.Debug("Restarting locaiton services"); targetList = new LocationTargetList(Convert(activeMmos).ToArray()); logger.Debug("TargetList: " + JsonUtility.ToJson(targetList)); if (native) { ChangeState(State.LOCATION_STARTED); nativeLocation.StartService(CONFIG, targetList); } if (unity) { unityLocation.SetLocationHandler(HandleLocationFound); unityLocation.StartService(CONFIG, targetList); } if (native || unity) { uiManager.ShowWatchAll(true); } }