Exemplo n.º 1
0
        private void AddPlayerRow(string name, BoltEntity client, bool showButtons)
        {
            PlayerListRow playerListRow = UnityEngine.Object.Instantiate <PlayerListRow>(this._rowPrefab);

            playerListRow.transform.parent        = this._grid.transform;
            playerListRow.transform.localPosition = Vector3.zero;
            playerListRow.transform.localScale    = Vector3.one;
            playerListRow._entity             = client;
            playerListRow._overlay._name.text = name;
            if (showButtons && client)
            {
                EventDelegate eventDelegate = new EventDelegate(this, "Kick");
                eventDelegate.parameters[0] = new EventDelegate.Parameter(client.source.RemoteEndPoint.SteamId.Id);
                playerListRow._kickButton.onClick.Add(eventDelegate);
                playerListRow._kickButton.gameObject.SetActive(true);
                EventDelegate eventDelegate2 = new EventDelegate(this, "Ban");
                eventDelegate2.parameters[0] = new EventDelegate.Parameter(client.source.RemoteEndPoint.SteamId.Id);
                playerListRow._banButton.onClick.Add(eventDelegate2);
                playerListRow._banButton.gameObject.SetActive(true);
            }
            else
            {
                playerListRow._kickButton.gameObject.SetActive(false);
                playerListRow._banButton.gameObject.SetActive(false);
            }
        }
Exemplo n.º 2
0
        private void AddPlayerRow(string name, BoltEntity entity, bool showButtons)
        {
            PlayerListRow playerListRow = UnityEngine.Object.Instantiate <PlayerListRow>(this._rowPrefab);

            playerListRow.transform.parent        = this._grid.transform;
            playerListRow.transform.localPosition = Vector3.zero;
            playerListRow.transform.localScale    = Vector3.one;
            playerListRow._entity             = entity;
            playerListRow._overlay._name.text = name;
            if (showButtons)
            {
                EventDelegate eventDelegate = new EventDelegate(this, "KickByName");
                eventDelegate.parameters[0] = new EventDelegate.Parameter(name);
                playerListRow._kickButton.onClick.Add(eventDelegate);
                playerListRow._kickButton.gameObject.SetActive(true);
                EventDelegate eventDelegate2 = new EventDelegate(this, "BanByName");
                eventDelegate2.parameters[0] = new EventDelegate.Parameter(name);
                playerListRow._banButton.onClick.Add(eventDelegate2);
                playerListRow._banButton.gameObject.SetActive(true);
            }
            else
            {
                playerListRow._kickButton.gameObject.SetActive(false);
                playerListRow._banButton.gameObject.SetActive(false);
            }
            playerListRow._profileButton.gameObject.SetActive(false);
        }