Beispiel #1
0
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }

        if (audioSource == null)
        {
            audioSource = GetComponent <AudioSource>();
        }
    }
Beispiel #2
0
    // Start is called before the first frame update
    void Awake()
    {
        bgmManager  = this;
        audioSource = gameObject.GetComponent <AudioSource>();

        if (SceneManager.GetActiveScene().name != "TutorialScene" && SceneManager.GetActiveScene().name != "EndingScene")
        {
            string[] temp     = SceneManager.GetActiveScene().name.Split('e');
            int      stageNum = int.Parse(temp[1]);

            SelectBGM(stageNum);
        }
    }
Beispiel #3
0
 void Awake()
 {
     instance = this;
     DontDestroyOnLoad(gameObject);
 }
Beispiel #4
0
 void Start()
 {
     instance = GetComponent <BGMusicManager> ();
     // Plays the music as the User has not disabled the music settings....
     PlayMusic();
 }