using TMPro;
using UnityEngine;
using UnityEngine.UI;

public class UserButton : MonoBehaviour
{
    [Header("User")]
    // Reference to the user list, so we can extract the current user
    public UserList userList;

    [Header("UI References")]
    // Reference to the avatar object
    public Image avatar;
    // Reference to the username object
    public TMP_Text username;

    void Start()
    {
        User user = userList.GetCurrentUser();
        avatar.sprite = user.avatar;
        username.text = user.username;
    }
}
