Exemple #1
0
 // Setup and create level select button
 void SetUpLevelButton()
 {
     foreach (SceneStatus scenes in sceneStatus)
     {
         Button button = Instantiate(levelButtonPrefab, levelButtonParent);
         button.GetComponentInChildren <Text>().text = scenes.SceneName;
         button.onClick.AddListener(() => levelsManager.LoadSceneByIndex(scenes.SceneIndex));
         if (!scenes.IsOpen)
         {
             button.image.sprite = closedLevel;
             button.GetComponentInChildren <Text>().enabled = false;
             button.enabled = false;
         }
     }
 }