// Use this for initialization void Start() { theAM = FindObjectOfType <AudioTest>(); if (newTrack != null) { theAM.ChangeBGM(newTrack); } }
void OnTriggerEnter2D(Collider2D other) { if (other.gameObject.tag == "Player") { if (newTrack != null) { theAM = FindObjectOfType <AudioTest>(); theAM.ChangeBGM(newTrack); } } }