123456789101112131415161718192021222324252627282930313233343536373839 |
- using System;
- using Api;
- using UI.Hall;
- using UnityEngine;
- using UnityEngine.UI;
- namespace UI.Items
- {
- public class OnlinePlayerItemComp : MonoBehaviour
- {
- public Text NameText;
- public Text PlayerIdText;
- public Image Avatar;
- public GameObject InviteButton;
- private Action<int> _inviteClick;
- private PlayerInfo _player;
- public void init(Action<int> OnInviteClick, PlayerInfo dataPlayer)
- {
- _inviteClick = OnInviteClick;
- _player = dataPlayer;
- refreshUI();
- }
- private void refreshUI()
- {
- NameText.text = _player.name;
- PlayerIdText.text = "ID:"+_player.id + "";
- AvatarUtil.DisplayAvatar(Avatar, _player.avatar);
- }
- public void A__ClickInvite()
- {
- _inviteClick.Invoke(_player.id);
- }
- }
- }
|