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
+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);
}));
}
}