last update

This commit is contained in:
2022-12-28 13:43:10 +05:00
parent de27cee945
commit 9486dbcb03
12 changed files with 4653 additions and 2003 deletions
+3
View File
@@ -26,6 +26,7 @@ public class GameSystem : MonoBehaviour
[Space]
[SerializeField] UIMainMenu mainMenu;
[SerializeField] UICanvas trainsMenu;
[SerializeField] UICanvas aboutMenu;
[Space]
public UICanvas trainEP2D;
public UICanvas train2;
@@ -101,6 +102,7 @@ public class GameSystem : MonoBehaviour
FindObjectOfType<SceneHandler>().OnSceneLoaded.AddListener(()=>
{
mainMenu.gameObject.SetActive(true);
aboutMenu.gameObject.SetActive(true);
});
}
@@ -167,6 +169,7 @@ public class GameSystem : MonoBehaviour
DontDestroyOnLoad(item.gameObject);
Instance = this;
Screen.sleepTimeout = 0;
}
void Start()
+8 -7
View File
@@ -3,29 +3,30 @@ using System.Collections.Generic;
using DG.Tweening;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.Events;
[RequireComponent(typeof(CanvasGroup))]
public class LogoHandler : MonoBehaviour
{
[SerializeField] private CanvasGroup logo;
[SerializeField] UnityEvent OnTimerEnded;
private CanvasGroup canvasGroup;
IEnumerator Start()
{
DontDestroyOnLoad(gameObject);
canvasGroup = GetComponent<CanvasGroup>();
var sceneLoading = SceneManager.LoadSceneAsync(1, LoadSceneMode.Single);
while(!sceneLoading.isDone)
yield return null;
yield return new WaitForSeconds(2);
logo.DOFade(0, .4f)
.OnComplete(() => canvasGroup
.DOFade(0, .8f)
.OnComplete(() => Destroy(this.gameObject)));
.OnComplete(() =>
{
OnTimerEnded?.Invoke();
Destroy(this.gameObject);
}));
}
}
+12 -11
View File
@@ -63,21 +63,24 @@ public class QRCodeReader : MonoBehaviour
var ratio = (float)camTexture.width / (float)camTexture.height;
aspectRatioFitter.aspectRatio = ratio;
float scaleY = 1;
float scaleY = -1;
if(Application.platform == RuntimePlatform.Android)
{
scaleY = camTexture.videoVerticallyMirrored ? -1f : 1f;
rawImage.rectTransform.localScale = new Vector3(1f, scaleY, 1f);
}
else
{
ratio = (float)camTexture.height / (float)camTexture.width;
rawImage.rectTransform.localScale = new Vector3(1f, -1f, 1f);
}
rawImage.rectTransform.localScale = new Vector3(1f, scaleY, 1f);
ScanningQRCode();
}
// void Update()
// {
// cameraCrop = new Texture2D(camTexture.width, camTexture.height);
// cameraCrop.SetPixels32(camTexture.GetPixels32());
// cameraCrop.Apply();
// cropImage.texture = cameraCrop;
// }
public void ScanningQRCode()
{
if(c_QRScanningRoutine != null)
@@ -112,8 +115,6 @@ public class QRCodeReader : MonoBehaviour
yield return new WaitForSeconds(.5f);
}
yield return new WaitForSeconds(1);
if(!loadingCanvas.gameObject.activeSelf)
loadingCanvas.gameObject.SetActive(true);