public void SelectPuzzleLevel () { int level = int.Parse (UnityEngine.EventSystems.EventSystem.current.currentSelectedGameObject.name); puzzle = levelLocker.GetPuzzleLevels (selectedPuzzle); if (puzzle [level]) { puzzleGameManager.SetLevel (level); loadPuzzleGame.LoadPuzzle (level, selectedPuzzle); } }
//Passing level selected to next scene via holder class public void SelectPuzzleLevel() { //getting the current selected level int level = int.Parse(UnityEngine.EventSystems.EventSystem.current.currentSelectedGameObject.name); puzzle = levelLocker.GetPuzzleLevels(); if (puzzle[level]) { LevelHolder.currentLevel = level; SceneManager.LoadScene(1); } }
public void SelectPuzzleLevel() { //starsLocker.DeactivateStars(); //since our levels are 0, 1, 2, ... etc, but names are stored at strings, we want the integer value of the level name which is a number int level = int.Parse(UnityEngine.EventSystems.EventSystem.current.currentSelectedGameObject.name); puzzle = levelLocker.GetPuzzleLevels(selectedPuzzle); if (puzzle[level]) { puzzleGameManager.SetLevel(level); loadPuzzleGame.LoadPuzzle(level, selectedPuzzle); } }