Sound + somewhat game loop
This commit is contained in:
parent
29e5e48aee
commit
1d6a879755
33 changed files with 1572 additions and 595 deletions
|
@ -7,12 +7,12 @@ using UnityEngine.SceneManagement;
|
|||
public class GameManager : MonoBehaviourSingletonPersistent<GameManager>
|
||||
{
|
||||
[SerializeField] private List<string> levelNames;
|
||||
[SerializeField] private List<string> levelMusics;
|
||||
[SerializeField] private List<int> levelsMoney;
|
||||
int current_level = -1;
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
GoNextLevel();
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
|
@ -57,6 +57,7 @@ public class GameManager : MonoBehaviourSingletonPersistent<GameManager>
|
|||
current_level++;
|
||||
SetGlobals(current_level);
|
||||
SceneManager.LoadScene(levelNames[current_level]);
|
||||
SoundManager.Instance.PlayMusic(levelMusics[current_level]);
|
||||
}
|
||||
|
||||
throw new Exception("Bro there is no next level like stop pls");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue