Files
unity-application/Assets/Common/Scripts/UserButton.cs
Dries Van Schuylenbergh 852a17b0b4 Integrate minigame and courses
2023-03-08 19:07:57 +00:00

26 lines
613 B
C#

using System.Collections;
using System.Collections.Generic;
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.users[userList.currentUserIndex];
avatar.sprite = user.avatar;
username.text = user.username;
}
}