Exemplo n.º 1
0
    void BuildLevelSelect()
    {
        for (int i = 0; i < _levelNames.Count; i++)
        {
            var levelGO = Instantiate(_levelPrefab, transform);
            levelGO.GetComponentInChildren <Text>().text = (i + 1).ToString();

            string levelName = _levelNames[i];
            levelGO.GetComponent <Button>().onClick.AddListener(() => _sceneSwapper.StartLoadScene(levelName));
        }
    }
Exemplo n.º 2
0
 public void WinLevel()
 {
     _sceneSwapper.StartLoadScene(_nextLevel);
 }