33 lines
1021 B
C#
33 lines
1021 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using Kill.Managers;
|
|
using Kill.UI.Components;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
namespace Kill.UI.Pages
|
|
{
|
|
public class SelfQrcodePage : MonoBehaviour
|
|
{
|
|
public Text usernameText;
|
|
public Text emailText;
|
|
public Text userIdText;
|
|
public Button backButton;
|
|
public QRCodeGenerator qrCodeGenerator;
|
|
public void Init(UserInfo userInfo)
|
|
{
|
|
UIManager.Instance.RegisterBackAction(OnBack);
|
|
backButton.onClick.RemoveAllListeners();
|
|
backButton.onClick.AddListener(OnBack);
|
|
usernameText.text = userInfo.username;
|
|
emailText.text = userInfo.email;
|
|
userIdText.text = $"User ID: {userInfo.id}";
|
|
qrCodeGenerator.Generate(userInfo.id);
|
|
}
|
|
public void OnBack()
|
|
{
|
|
UIManager.Instance.RegisterBackAction(GetComponentInParent<SelfPage>().OnBack);
|
|
Destroy(gameObject);
|
|
}
|
|
}
|
|
}
|