void GetOpponent() { List <Player> players = DatabaseDataAcces.getAllPlayers(); while (true) { int ind = UnityEngine.Random.Range(0, players.Count); opponent = players[ind]; if (opponent.id != player.id) { break; } } }
// Start is called before the first frame update void Start() { List <Player> players = DatabaseDataAcces.getAllPlayers(); dropdown.ClearOptions(); foreach (Player p in players) { dropdown.options.Add(new Dropdown.OptionData() { text = p.nickname }); } dropdown.RefreshShownValue(); }