상속: MonoBehaviour
예제 #1
0
    void OnEnable()
    {
        if (done)
        {
            return;
        }
        // Get an array of players
        Player[] players = PlayerManager.GetAllPlayers();

        foreach (Player player in players)
        {
            Debug.Log(player.playerNum + " | " + player.deaths);

            GameObject itemGO = Instantiate(scoreboardItem, scoreboardPlayerList);
            Debug.Log("otemGO: " + itemGO);

            PlayerScoreboardItem item = itemGO.GetComponent <PlayerScoreboardItem>();
            Debug.Log(item);
            if (item != null)
            {
                item.Setup(player.playerNum, player.deaths);
                done = true;
            }
        }
    }
예제 #2
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);
         }
     }
 }
예제 #3
0
 void OnEnable()
 {
     Player[] players = GameManager.GetAllPlayers();
     foreach (Player player in players)
     {
         GameObject           ItemGO = Instantiate(playerScoreBoardItem, playerScoreBoardList);
         PlayerScoreboardItem item   = ItemGO.GetComponent <PlayerScoreboardItem>();
         if (item != null)
         {
             item.Setup(player.username, player.Kills, player.Deaths);
         }
     }
 }
예제 #4
0
    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);
            }
        }
    }
예제 #5
0
    private void OnEnable()
    {
        TankManager[] tanks = GameManager.getAllPlayers();

        foreach (var tank in tanks)
        {
            GameObject           itemGO = Instantiate(playerScoreboardItemPrefab, playerScoreboardParent);
            PlayerScoreboardItem item   = itemGO.GetComponent <PlayerScoreboardItem>();
            if (item != null)
            {
                item.Setup(tank.username, tank.deaths);
            }
        }
    }
예제 #6
0
    private void OnEnable()
    {
        Player[] players = GameManager.GetAllPlayers();

        foreach (Player player in players)
        {
            GameObject           itemGO = (GameObject)Instantiate(playerScoreboardItemPrefab, playerList);
            PlayerScoreboardItem item   = itemGO.GetComponent <PlayerScoreboardItem>();
            if (item != null)
            {
                item.Setup(player.name, player.kills.ToString(), player.deaths.ToString());
            }
        }
    }
예제 #7
0
    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)
            {
                Debug.Log(player._playerName + " k:" + player.kills.ToString() + "d:" + player.deaths.ToString());
                item.Setup(player._playerName, player.kills, player.deaths);
            }
        }
    }
예제 #8
0
    void OnEnable()
    {
        // Get an array of  players
        Player[] players = GameManager.GetAllPlayers();

        foreach (Player p in players)
        {
            GameObject           itemGO = (GameObject)Instantiate(playerScoreboardItemPrefab, playerScoreboardList);
            PlayerScoreboardItem item   = itemGO.GetComponent <PlayerScoreboardItem>();
            if (item != null)
            {
                item.Setup(p.username, p.kills, p.death);
            }
        }
    }
    private void OnEnable()
    {
        // TODO : Sort the list by score
        GameObject[] players = sgm.GetPlayers();

        foreach (GameObject player in players)
        {
            GameObject           itemGameObject = Instantiate(playerScoreboardItemPrefab, playerScoreboardList);
            PlayerScoreboardItem item           = itemGameObject.GetComponent <PlayerScoreboardItem>();
            if (item != null)
            {
                item.Setup(player.GetComponent <SnakeSetUpPlayer>().GetPlayerName(), player.GetComponent <SnakeTailController>().GetTail().Count);
            }
        }
    }
예제 #10
0
    void OnEnable()
    {
        playersGO = GameObject.FindGameObjectsWithTag("Player");

        foreach (GameObject player in playersGO)
        {
            GameObject itemGO = (GameObject)Instantiate(playerScoreboardItem);
            itemGO.transform.SetParent(playerScoreboardList);

            PlayerScoreboardItem item = itemGO.GetComponent <PlayerScoreboardItem>();
            if (item != null)
            {
                item.Setup(player.GetComponent <Player>().username, player.GetComponent <Player>().GetKills(), player.GetComponent <Player>().GetDeaths(), player.GetComponent <Player>().GetBestCombo());
            }
        }
    }
예제 #11
0
    void OnEnable()
    {
        // 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)
        {
            //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);
            }
        }
    }
예제 #12
0
    // Gets all player data on enabling
    void OnEnable()
    {
        // get and array of players
        List <Player> allPlayers = GameManager.GetAllPlayers();

        GameManager.GetAllPlayers();

        // loop through and set up a list item for each player
        foreach (Player player in allPlayers)
        {
            GameObject           itemGo = Instantiate(playerScoreboardPrefab, playerScoreboardList);
            PlayerScoreboardItem item   = itemGo.GetComponent <PlayerScoreboardItem>();
            if (item)
            {
                item.Setup(player.name, player.kills);
            }
        }
    }
예제 #13
0
    private void OnEnable()
    {
        Player[] players = GameManger.GetAllPlayers();
        Array.Sort(players, ComparePlayers);

        foreach (Player player in players)
        {
            GameObject           itemGO = Instantiate(playerScoreboardItem, playerScoreboardList) as GameObject;
            PlayerScoreboardItem item   = itemGO.GetComponent <PlayerScoreboardItem>();
            if (item != null)
            {
                item.Setup(player.playerName, player.score, player.kills, player.deaths);
            }
            if (player.isLocalPlayer)
            {
                item.GetComponent <Image>().color = Color.cyan;
            }
        }
    }
예제 #14
0
    void OnEnable()
    {
        //Get anarray of players
        PlayerObject[] players = GameManagerCar.GetAllPlayers();

        //Loop through andsetup listitem foreach one
        foreach (PlayerObject player in players)
        {
            Debug.Log(player.username + "|" + player.Kills + "|" + player.Deaths);
            GameObject itemGO = (GameObject)Instantiate(ScoreboardItem_Prefab, ScoreboardItem_Holder);

            PlayerScoreboardItem item = itemGO.GetComponent <PlayerScoreboardItem>();

            if (item != null)
            {
                item.Setup(player.username, player.Kills, player.Deaths);
            }
        }
    }
예제 #15
0
    //[Command]
    void GetAllPlayers()
    {
        SpellslingerScript[] spellSlingers = GameManager.GetAllPlayers();

        foreach (SpellslingerScript spellSlinger in spellSlingers)
        {
            if (spellSlinger != null)
            {
                GameObject           itemGO = (GameObject)Instantiate(playerScoreboardItemPrefab, playerScoreboardList);
                PlayerScoreboardItem item   = itemGO.GetComponent <PlayerScoreboardItem>();


                if (item != null)
                {
                    Debug.Log("Spellslinger Name is: " + spellSlinger.name);
                    item.Setup(spellSlinger.name, spellSlinger.GetComponent <Health>().GetPlayerDeaths(), spellSlinger.GetSpellslingerKills());
                }
            }
        }
    }
예제 #16
0
    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);
            }

            foreach (Renderer c in player.gameObject.GetComponentsInChildren <Renderer>())
            {
                //Debug.Log(item.material.color+" "+ colorHolder.playerColor);
                c.material.color = player.playerColor;
                //Debug.Log(item.material.color + " " + colorHolder.playerColor);
            }
        }
    }