using GatherAndDefend.Events; using System.Collections; using System.Threading.Tasks; using UnityEngine; using UnityEngine.SceneManagement; using UnityEngine.UI; /// /// manages the logic of loading /// public class LoadingManager : MonoBehaviour { public const string LevelToLoad = nameof(LevelToLoad); public const string SceneToLoad = nameof(SceneToLoad); public const int NoLevel = -1; private LoadingScreen loadingScreen; void Start() { loadingScreen = GetComponent(); EventAggregator.Instance.GetEvent().Attach(LoadTargetSceneAndCloseOthers); loadingScreen.ShowLoadingScreen(); } void Update() { foreach (var button in FindObjectsOfType