2024-06-24 01:57:54 -07:00
|
|
|
using System;
|
|
|
|
using GadGame.Event.Customs;
|
|
|
|
using GadGame.Event.Type;
|
|
|
|
using GadGame.Network;
|
|
|
|
using TMPro;
|
|
|
|
using UnityEngine;
|
|
|
|
using UnityEngine.UI;
|
|
|
|
|
|
|
|
public class QRShowNewCTA : MonoBehaviour
|
|
|
|
{
|
|
|
|
[SerializeField] private RawImage _rawImage;
|
|
|
|
[SerializeField] private VoidEvent _scanSuccess;
|
|
|
|
[SerializeField] private GuestEvent _guestUpdatedSubscription;
|
2024-06-24 20:41:35 -07:00
|
|
|
[SerializeField] private TMP_Text _descText;
|
2024-06-24 01:57:54 -07:00
|
|
|
|
|
|
|
|
|
|
|
async void Start()
|
|
|
|
{
|
2024-06-24 20:41:35 -07:00
|
|
|
_descText.text = UdpSocket.Instance.DataReceived.Description;
|
2024-06-24 01:57:54 -07:00
|
|
|
_rawImage.texture = await P4PGraphqlManager.Instance.GetQrLink();
|
|
|
|
// _timer.SetDuration(60).Begin();
|
|
|
|
}
|
|
|
|
|
|
|
|
private void OnEnable()
|
|
|
|
{
|
|
|
|
_guestUpdatedSubscription.Register(ShowInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
private void OnDisable()
|
|
|
|
{
|
|
|
|
_guestUpdatedSubscription.Unregister(ShowInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
private void ShowInfo(Guest guest) {
|
|
|
|
_scanSuccess.Raise();
|
|
|
|
}
|
|
|
|
}
|