Beispiel #1
0
    void populateNightPlayerList()
    {
        clearNightPlayerList();

        if (CanViewPlayerList())
        {
            foreach (KeyValuePair <string, Player> player in PlayerManager.Instance.playerList)
            {
                if (player.Value.Alive)
                {
                    PlayerListEntryUI newPlayerListEntry = Instantiate(night_PlayerListEntryPrefab, night_PlayerListParent) as PlayerListEntryUI;

                    if (!Player.Instance.Alive)
                    {
                        newPlayerListEntry.selectable = false;
                    }

                    newPlayerListEntry.nameText.text = player.Value.Name;
                    newPlayerListEntry.playerID      = player.Key;
                    newPlayerListEntry.gameObject.SetActive(true);
                    night_playerList.Add(newPlayerListEntry);
                }
            }
        }
    }
Beispiel #2
0
    void populateNightPlayerList()
    {
        clearNightPlayerList();

        PlayerListEntryUI MyPlayerListEntry = Instantiate(playerListEntryPrefab, playerListParent) as PlayerListEntryUI;

        MyPlayerListEntry.gameObject.SetActive(true);
        MyPlayerListEntry.selectable    = false;
        MyPlayerListEntry.nameText.text = Player.Instance.Name;
        playerList.Add(MyPlayerListEntry);

        foreach (KeyValuePair <string, Player> player in PlayerManager.Instance.playerList)
        {
            PlayerListEntryUI newPlayerListEntry = Instantiate(playerListEntryPrefab, playerListParent) as PlayerListEntryUI;
            newPlayerListEntry.selectable = false;
            newPlayerListEntry.gameObject.SetActive(true);
            newPlayerListEntry.nameText.text = player.Value.Name;
            playerList.Add(newPlayerListEntry);
        }
    }
Beispiel #3
0
    void populateDayPlayerList()
    {
        clearDayPlayerList();

        foreach (KeyValuePair <string, Player> player in PlayerManager.Instance.playerList)
        {
            if (player.Value.Alive)
            {
                PlayerListEntryUI newPlayerListEntry = Instantiate(day_PlayerListEntryPrefab, day_PlayerListParent) as PlayerListEntryUI;

                if (!Player.Instance.Alive)
                {
                    newPlayerListEntry.selectable  = false;
                    day_confirmButton.interactable = false;
                    day_confirmButtonText.text     = "You are Dead";
                }

                newPlayerListEntry.nameText.text = player.Value.Name;
                newPlayerListEntry.playerID      = player.Key;
                newPlayerListEntry.gameObject.SetActive(true);
                day_playerList.Add(newPlayerListEntry);
            }
        }
    }