Integrate minigame and courses
This commit is contained in:
25
Assets/Common/Scripts/UserButton.cs
Normal file
25
Assets/Common/Scripts/UserButton.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user