create menu UI

This commit is contained in:
2022-11-12 18:08:21 +05:00
parent a488ab8f99
commit 800e5fbbd6
17 changed files with 4936 additions and 2589 deletions
+10 -3
View File
@@ -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);
});
}
}