PlayLevelMusic() public method

public PlayLevelMusic ( ) : void
return void
Exemplo n.º 1
0
 //Once the level has loaded, check if we want to call PlayLevelMusic
 void OnLevelWasLoaded()
 {
     //if changeMusicOnStart is true, call the PlayLevelMusic function of playMusic
     if (changeMusicOnStart)
     {
         playMusic.PlayLevelMusic();
     }
 }
Exemplo n.º 2
0
 //Once the level has loaded, check if we want to call PlayLevelMusic
 void SceneWasLoaded(Scene scene, LoadSceneMode mode)
 {
     //if changeMusicOnStart is true, call the PlayLevelMusic function of playMusic
     if (menuSettingsData.musicLoopToChangeTo != null)
     {
         playMusic.PlayLevelMusic();
     }
 }
Exemplo n.º 3
0
 //Once the level has loaded, check if we want to call PlayLevelMusic
 void SceneWasLoaded(Scene scene, LoadSceneMode mode)
 {
     //if changeMusicOnStart is true, call the PlayLevelMusic function of playMusic
     if (changeMusicOnStart)
     {
         playMusic.PlayLevelMusic();
     }
 }
Exemplo n.º 4
0
    //Once the level has loaded, check if we want to call PlayLevelMusic
    void SceneWasLoaded(Scene scene, LoadSceneMode mode)
    {
        fadeOutImageCanvasGroup.alpha = 0.0f;

        //if changeMusicOnStart is true, call the PlayLevelMusic function of playMusic
        if (menuSettingsData.musicLoopToChangeTo != null)
        {
            playMusic.PlayLevelMusic();
        }
    }
Exemplo n.º 5
0
    void Awake()
    {
        //Get a reference to ShowPanels attached to UI object
        showPanels = GetComponent <ShowPanels>();

        //Get a reference to PlayMusic attached to UI object
        playMusic = GetComponent <PlayMusic>();

        //play main menu music
        playMusic.PlayLevelMusic();
    }
Exemplo n.º 6
0
    //Once the level has loaded, check if we want to call PlayLevelMusic
    void SceneWasLoaded(Scene scene, LoadSceneMode mode)
    {
        //if changeMusicOnStart is true, call the PlayLevelMusic function of playMusic
        if (menuSettingsData.musicLoopToChangeTo != null)
        {
            playMusic.PlayLevelMusic();
        }

        if (scene.buildIndex > 0)
        {
            StartCoroutine(FadeCanvasGroupAlpha(1f, 0f, fadeOutImageCanvasGroup));
        }
    }
Exemplo n.º 7
0
 //Once the level has loaded, check if we want to call PlayLevelMusic
 void SceneWasLoaded(Scene scene, LoadSceneMode mode)
 {
     foreach (var item in scene.GetRootGameObjects())
     {
         if (item.gameObject.GetComponent <MyGameManager>() != null)
         {
             MyGameManager gameManager = item.gameObject.GetComponent <MyGameManager>();
             gameManager.CurrentMode = gameMode;
         }
     }
     //if changeMusicOnStart is true, call the PlayLevelMusic function of playMusic
     if (menuSettingsData.musicLoopToChangeTo != null)
     {
         playMusic.PlayLevelMusic();
     }
 }
Exemplo n.º 8
0
    //Once the level has loaded, check if we want to call PlayLevelMusic
    void SceneWasLoaded(Scene scene, LoadSceneMode mode)
    {
        //if changeMusicOnStart is true, call the PlayLevelMusic function of playMusic
        if (menuSettingsData.musicLoopToChangeTo != null)
        {
            playMusic.PlayLevelMusic();
        }
        Debug.Log("OnSceneLoaded: " + scene.name);
        Debug.Log(mode);

        if (scene.name != "MainMenu")
        {
            Debug.Log("OnSceneLoaded: not MainMenu is " + scene.name);
            StartCoroutine(FadeCanvasGroupAlphaHideMenu(1f, 0f, fadeOutImageCanvasGroup));
            StartCoroutine(FadeCanvasGroupAlphaHideMenu(1f, 0f, BackgroundImageCanvasGroup));
        }
        else
        {
            Debug.Log("OnSceneLoaded: so MainMenu is " + scene.name);
            showPanels.ShowMenu();
            StartCoroutine(FadeCanvasGroupAlpha(0f, 1f, BackgroundImageCanvasGroup));
        }
    }
Exemplo n.º 9
0
 //Once the level has loaded, check if we want to call PlayLevelMusic
 void SceneWasLoaded(Scene scene, LoadSceneMode mode)
 {
     playMusic.PlayLevelMusic();
 }