private void LookupCardGames() { if (!Directory.Exists(UnityCardGame.GamesDirectoryPath) || Directory.GetDirectories(UnityCardGame.GamesDirectoryPath).Length < 1) { CreateDefaultCardGames(); } foreach (string gameDirectory in Directory.GetDirectories(UnityCardGame.GamesDirectoryPath)) { string gameDirectoryName = gameDirectory.Substring(UnityCardGame.GamesDirectoryPath.Length + 1); (string gameName, _) = CardGame.GetNameAndHost(gameDirectoryName); if (gameName.Equals(CardGame.DefaultName)) { Debug.LogWarning(DefaultNameWarning); try { Directory.Delete(gameDirectory, true); } catch (Exception ex) { Debug.LogError(DeleteErrorMessage + ex.Message); } } else { var newCardGame = new UnityCardGame(this, gameDirectoryName); newCardGame.ReadProperties(); if (!string.IsNullOrEmpty(newCardGame.Error)) { Debug.LogError(LoadErrorMessage + newCardGame.Error); } else { AllCardGames[newCardGame.Id] = newCardGame; } } } }