public void OpenRecentMap() { if (MapLuaParser.Current.ScenarioFileName == PlayerPrefs.GetString(LoadRecentMaps.ScenarioFile + LoadRecentMaps.RecentMapSelected, "") && MapLuaParser.Current.FolderName == PlayerPrefs.GetString(LoadRecentMaps.FolderPath + LoadRecentMaps.RecentMapSelected, "") && MapLuaParser.Current.FolderParentPath == PlayerPrefs.GetString(LoadRecentMaps.ParentPath + LoadRecentMaps.RecentMapSelected, "")) { Debug.LogWarning("Same map: Ignore loading recent map"); return; // Same map } if (MapLuaParser.IsMapLoaded) { PlaySystemSound.PlayBeep(); GenericPopup.ShowPopup(GenericPopup.PopupTypes.TriButton, "Save map", "Save current map before opening another map?", "Yes", OpenRecentMapYes, "No", OpenRecentMapNo, "Cancel", OpenMapCancel); } else { OpenRecentMapNo(); } }
private void OnPlaySystemSound(IComponentEvent componentEvent) { PlaySystemSound playSystemSound = componentEvent as PlaySystemSound; PlaySystemSound(playSystemSound.SoundID, playSystemSound.EndAction); }