123456789101112131415161718192021222324252627 |
- using UnityEngine;
- using System.Collections;
- using TMPro;
- /// <summary>
- /// This component is responsible of fading out the loading label found in the loading scene
- /// </summary>
- public class FadeOutLoading : MonoBehaviour
- {
- TextMeshProUGUI _label;
- void OnEnable()
- {
- _label = GetComponent<TextMeshProUGUI>();
- NotificationCenter.AddListener(OnFadeOutUpdate, NotificationType.LoadingFadeOutUpdate);
- }
- void OnDisable()
- {
- NotificationCenter.RemoveListener(OnFadeOutUpdate, NotificationType.LoadingFadeOutUpdate);
- }
- void OnFadeOutUpdate(Notification note)
- {
- _label.alpha = (float)note.data;
- }
- }
|