private void Awake() { if (instance == null) { instance = this; } if (audioSource == null) { audioSource = GetComponent <AudioSource>(); } }
// 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); } }
void Awake() { instance = this; DontDestroyOnLoad(gameObject); }
void Start() { instance = GetComponent <BGMusicManager> (); // Plays the music as the User has not disabled the music settings.... PlayMusic(); }