Пример #1
0
    void Awake() {
        instance = this;
        
        if(Application.loadedLevelName == "MainMenu") {
            gameState = GlobalInfo.GameState.MENU;
        } else {
            gameState = GlobalInfo.GameState.INGAME;
        }

        MainCameraController.FindOrCreate();
        SoundController.FindOrCreate();
    }
Пример #2
0
 public void StartMusic(GlobalInfo.GameState gameState)
 {
     if (gameState == GlobalInfo.GameState.INGAME)
     {
         int randomSong = Random.Range(0, this.musicGame.Count);
         this._currentSong.clip = musicGame[randomSong] as AudioClip;
         this._currentSong.Play();
     }
     else if (gameState == GlobalInfo.GameState.MENU)
     {
         int randomSong = Random.Range(0, this.musicMenu.Count);
         this._currentSong.clip = musicMenu[randomSong] as AudioClip;
         this._currentSong.Play();
     }
 }
Пример #3
0
    void Awake()
    {
        instance = this;

        if (Application.loadedLevelName == "MainMenu")
        {
            gameState = GlobalInfo.GameState.MENU;
        }
        else
        {
            gameState = GlobalInfo.GameState.INGAME;
        }

        MainCameraController.FindOrCreate();
        SoundController.FindOrCreate();
    }