Update
This commit is contained in:
@@ -1,14 +1,37 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace UI
|
||||
namespace Hallucinate.UI
|
||||
{
|
||||
public class ProfileController : MonoBehaviour
|
||||
public class ProfileController : BaseUIController
|
||||
{
|
||||
private void OnEnable()
|
||||
private Label _username;
|
||||
private Label _rank;
|
||||
private ProgressBar _winRateBar;
|
||||
private Label _winRateText;
|
||||
|
||||
public override void Initialize(VisualElement uxmlRoot, UIManager manager)
|
||||
{
|
||||
var root = GetComponent<UIDocument>().rootVisualElement;
|
||||
root.Q<Button>("btn-close")?.RegisterCallback<ClickEvent>(ev => UIManager.Instance.GoBack());
|
||||
base.Initialize(uxmlRoot, manager);
|
||||
|
||||
_username = root.Q<Label>("Username");
|
||||
_rank = root.Q<Label>("Rank");
|
||||
_winRateBar = root.Q<ProgressBar>("WinRateBar");
|
||||
_winRateText = root.Q<Label>("WinRateText");
|
||||
|
||||
root.Q<Button>("BackBtn").clicked += () => uiManager.Pop();
|
||||
|
||||
LoadProfileData();
|
||||
}
|
||||
|
||||
private void LoadProfileData()
|
||||
{
|
||||
// Dummy data for now
|
||||
_username.text = "GamerPro_2026";
|
||||
_rank.text = "DIAMOND II";
|
||||
_winRateBar.value = 72;
|
||||
_winRateText.text = "72%";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user