Exemplo n.º 1
0
    public void DiscoverGamesList()
    {
        var games = worldBuilder.GetGames();

        foreach (var option in gameTypeDropdown.options.Skip(3).ToList())
        {
            if (!games.ContainsKey(option.text))
            {
                gameTypeDropdown.options.Remove(option);
            }
        }

        foreach (var name in games.Keys)
        {
            if (gameTypeDropdown.options.All(option => option.text != name))
            {
                gameTypeDropdown.options.Add(new Dropdown.OptionData(name));
            }
        }
    }