void Awake() { GameObject go = GameObject.Find("SoundManager"); backgroundMusic other = (backgroundMusic)go.GetComponent(typeof(backgroundMusic)); tone = other.getTone(); }
public void Dead() { GameObject go = GameObject.Find("SoundManager"); backgroundMusic other = (backgroundMusic)go.GetComponent(typeof(backgroundMusic)); bool tone = other.getTone(); if (tone == true) { source.PlayOneShot(die); } }