コード例 #1
0
ファイル: Scoreboard.cs プロジェクト: Alzahel/Cyberball
 private void FillScoreBoard()
 {
     foreach (NetworkGamePlayer player in GameManager.Instance.Players)
     {
         Debug.Log(player.Username + player.Kills + player.Deaths);
         GameObject           itemGO = Instantiate(playerScoreBoardItem, PlayerScoreBoardList);
         PlayerScoreBoardItem item   = itemGO.GetComponent <PlayerScoreBoardItem>();
         if (item != null)
         {
             item.Setup(player.Username, player.Goals, player.Kills, player.Deaths);
         }
     }
 }
コード例 #2
0
    private void OnEnable()
    {
        //recuperer une array de tous les joueurs du serveurs
        Player[] players = GameManager.GetAllPlayers();

        foreach (Player player in players)
        {
            GameObject           itemGO = Instantiate(playerScoreBoardItem, playerScoreBoardList);
            PlayerScoreBoardItem item   = itemGO.GetComponent <PlayerScoreBoardItem>();
            item.Setup(player);
            Debug.Log(player.name + " " + player.kills + " " + player.deaths);
        }
        //boucle sur l'array et mise en place d'une ligne pour chaque joueur + remplissage de la ligne
    }
コード例 #3
0
 private void OnEnable()
 {
     Player[] players = GameManager.GetAllPlayers();
     foreach (Player player in players)
     {
         GameObject           itemGo = (GameObject)Instantiate(playerScoreBoardItem, playerScoreBoardList);
         PlayerScoreBoardItem item   = itemGo.GetComponent <PlayerScoreBoardItem>();
         if (item != null)
         {
             item.SetUp(player.username, player.kills, player.deaths, player.points);
         }
     }
     //Loop through and set up a list item for each one
     //Setting the ui elements equals to the relevant data
 }
コード例 #4
0
    private void OnEnable()
    {
        // Get an array of players
        Player[] players = GameManager.GetAllPlayers();

        foreach (Player player in players)
        {
            //Debug.Log(player.username + " | " + player.kills + " / " + player.deaths);
            GameObject           itemGO = (GameObject)Instantiate(playerScoreboardItem, playerScoreboardList);
            PlayerScoreBoardItem item   = itemGO.GetComponent <PlayerScoreBoardItem>();
            if (item != null)
            {
                item.Setup(player.username, player.kills, player.deaths);
            }
        }
    }
コード例 #5
0
    void OnEnable()    //this will be called when enabled through the UI
    {
        //Get an array of players
        Player[] players = GameManager.GetAllPlayers();

        //loop through and set up a list item for each one
        foreach (Player player in players)
        {
            GameObject itemGO = (GameObject)Instantiate(playerScoreBoardItem, playerScoreBoardList);
            Debug.Log(player.username + " | " + player.kills + " | " + player.deaths);
            PlayerScoreBoardItem item = itemGO.GetComponent <PlayerScoreBoardItem>();
            if (item != null)
            {
                item.Setup(player.username, player.kills, player.deaths);
            }
        }
    }
コード例 #6
0
ファイル: ScoreBoard.cs プロジェクト: DocJesus/FPS_Multi
    private void OnEnable()
    {
        Debug.Log("SetUp du scoreBoard");
        //récupère une array contenant tout les joueurs
        Player[] players = GameManager.getAllPLayers();
        //loop dans l'array
        foreach (Player player in players)
        {
            Debug.Log("player.name = " + player.username + " player.kills : " + player.kills + " players.death : " + player.death);
            //on instancie le nom du joueur dans le cadre (on peut mettre juste un transform)
            GameObject itemGO = (GameObject)Instantiate(PlayerScoreboardItem, PlayerScoreboardList);
            //on récupère le script
            PlayerScoreBoardItem item = itemGO.GetComponent <PlayerScoreBoardItem>();

            if (item != null)
            {
                item.Setup(player.username, player.kills, player.death);
            }
        }
        //mis en pace des éléments de l'UI et les bonnes données
    }