smart-interactive-display/Assets/GadGame/Scripts/QRShowNewCTA.cs

40 lines
942 B
C#
Raw Normal View History

2024-06-24 01:57:54 -07:00
using System;
2024-06-27 01:08:10 -07:00
using Cysharp.Threading.Tasks;
2024-06-24 01:57:54 -07:00
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();
2024-06-27 01:08:10 -07:00
2024-06-24 01:57:54 -07:00
// _timer.SetDuration(60).Begin();
}
private void OnEnable()
{
_guestUpdatedSubscription.Register(ShowInfo);
}
private void OnDisable()
{
_guestUpdatedSubscription.Unregister(ShowInfo);
}
private void ShowInfo(Guest guest) {
_scanSuccess.Raise();
}
}