Resolve WES-56 "Account switching"
This commit is contained in:
committed by
Jelle De Geest
parent
0ea743354b
commit
b6b863183e
@@ -23,4 +23,9 @@ public class StartScreenManager : MonoBehaviour
|
||||
SceneManager.LoadScene("Accounts/Scenes/UserCreationScreen");
|
||||
}
|
||||
}
|
||||
|
||||
public void QuitApplication()
|
||||
{
|
||||
Application.Quit();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
|
||||
/// <summary>
|
||||
@@ -13,15 +14,20 @@ public class UserButton : MonoBehaviour
|
||||
public UserList userList;
|
||||
|
||||
/// <summary>
|
||||
/// UI Reference to the avatar object
|
||||
/// UI reference to the avatar object
|
||||
/// </summary>
|
||||
public Image avatar;
|
||||
|
||||
/// <summary>
|
||||
/// UI Reference to the username object
|
||||
/// UI reference to the username object
|
||||
/// </summary>
|
||||
public TMP_Text username;
|
||||
|
||||
/// <summary>
|
||||
/// UI reference to the dropdown box with all options
|
||||
/// </summary>
|
||||
public GameObject dropdownBox;
|
||||
|
||||
/// <summary>
|
||||
/// Start is called before the first frame update
|
||||
/// </summary>
|
||||
@@ -30,5 +36,30 @@ public class UserButton : MonoBehaviour
|
||||
User user = userList.GetCurrentUser();
|
||||
avatar.sprite = user.avatar;
|
||||
username.text = user.username;
|
||||
dropdownBox.SetActive(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Change to the UserProgressScreen scene
|
||||
/// </summary>
|
||||
public void OpenProgressCallback()
|
||||
{
|
||||
SceneManager.LoadScene("Accounts/Scenes/UserProgressScreen");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Change to the ChangeUserScreen scene
|
||||
/// </summary>
|
||||
public void ChangeUserCallback()
|
||||
{
|
||||
SceneManager.LoadScene("Accounts/Scenes/ChangeUserScreen");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Toggle the dropdown box
|
||||
/// </summary>
|
||||
public void ToggleDropdown()
|
||||
{
|
||||
dropdownBox.SetActive(!dropdownBox.activeSelf);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user