public GameObject LoadLevel(int index) { if (currentLevelIndex == index) { return(null); } currentLevelIndex = index; currentLevel = Instantiate(LevelDictionary[index]); LoadedLevel.Add(currentLevel); foreach (GameObject obj in currentLevel.GetComponent <LevelInfo>().breakable) { obj.GetComponent <Explodable>().fragmentInEditor(); } // PlayerHolder.GetComponentInChildren<MouseIndicator>().Show(); OnStartLevel.Invoke(index); return(currentLevel); }
public void StartNextLevel() { NextLevelMenu.SetActive(false); MainMenu.SetActive(false); OnStartLevel?.Invoke(); }