IEnumerator AddLoadingScene(string sceneName) { yield return(SceneManager.LoadSceneAsync("LoadingScreen", LoadSceneMode.Additive)); loadingBehavior = FindObjectOfType <LoadingBehavior>(); yield return(new WaitForSecondsRealtime(1f)); StartCoroutine(AddScene(sceneName)); }
private void Awake() { if (Instance == null) { Instance = this; } else if (Instance != this) { Destroy(gameObject); } }