Exemple #1
0
    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);
    }
Exemple #2
0
 public void StartNextLevel()
 {
     NextLevelMenu.SetActive(false);
     MainMenu.SetActive(false);
     OnStartLevel?.Invoke();
 }