create menu UI
This commit is contained in:
@@ -4,6 +4,7 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using ZXing;
|
||||
using DG.Tweening;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
@@ -11,8 +12,7 @@ public class QRCodeReader : MonoBehaviour
|
||||
{
|
||||
public static QRCodeReader Instance { get; private set; }
|
||||
|
||||
public event Action<string> OnQRCodeRead;
|
||||
|
||||
[SerializeField] CanvasGroup loadingCanvas;
|
||||
[SerializeField] AspectRatioFitter aspectRatioFitter;
|
||||
public RawImage rawImage;
|
||||
public GameObject scanFrame;
|
||||
@@ -105,6 +105,13 @@ public class QRCodeReader : MonoBehaviour
|
||||
|
||||
yield return new WaitForSeconds(1);
|
||||
|
||||
OnQRCodeRead?.Invoke(result.Text);
|
||||
if(!loadingCanvas.gameObject.activeSelf)
|
||||
loadingCanvas.gameObject.SetActive(true);
|
||||
|
||||
loadingCanvas.DOFade(1, .5f).OnComplete(() =>
|
||||
{
|
||||
FindObjectOfType<GameSystem>()
|
||||
.LoadScene(result.Text);
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user