IEnumerator LoadLevel(int lvl, float delay = 0) { yield return(new WaitForSeconds(delay)); asyncLoadLevel = SceneManager.LoadSceneAsync(lvl, LoadSceneMode.Single); while (!asyncLoadLevel.isDone) { yield return(null); } ActiveGrid = FindObjectOfType <LvlGrid>(); print("Scene Loaded"); }
void Start() { if (instance != null) { Destroy(gameObject); return; } instance = this; DontDestroyOnLoad(this); ActiveGrid = FindObjectOfType <LvlGrid>(); }