Пример #1
0
    internal void EntryClick(CouncilPlayerEntry councilPlayerEntry)
    {
        PlayerState state = PlayerBehaviour.Local.State;

        foreach (CouncilPlayerEntry entry in _playerEntries)
        {
            if (entry != councilPlayerEntry)
            {
                entry.AcceptButton.gameObject.SetActive(false);
                entry.CancelButton.gameObject.SetActive(false);
            }
            else if (state == PlayerState.Alive && !GameManager.Instance.AlreadyVoted(PlayerBehaviour.Local))
            {
                entry.AcceptButton.gameObject.SetActive(true);
                entry.CancelButton.gameObject.SetActive(true);
            }
        }
    }
Пример #2
0
    private void OnPlayerReport(PlayerBehaviour obj)
    {
        SetGroupActive(true);

        foreach (Transform t in LayoutGroup.transform)
        {
            Destroy(t.gameObject);
        }
        _playerEntries.Clear();

        List <PlayerBehaviour> players = GameManager.Instance.Players;

        players.Sort((a, b) => a.State == PlayerState.Alive ? -1 : 1);

        foreach (PlayerBehaviour player in GameManager.Instance.Players)
        {
            CouncilPlayerEntry entry = Instantiate(PlayerEntryPrefab, LayoutGroup.transform);
            entry.Council                 = this;
            entry.PlayerBinding           = player;
            entry.RootButton.interactable = player.State == PlayerState.Alive;

            _playerEntries.Add(entry);
        }
    }