Files
unity-application/Assets/Common/Scripts/UserButton.cs
Dries Van Schuylenbergh 2fa54620ef Wes xx build fix
2023-03-09 12:44:11 +00:00

24 lines
537 B
C#

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;
}
}