コード例 #1
0
    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;
            }
        }
    }
コード例 #2
0
    // 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();
    }