void OnTriggerEnter(Collider other) { if (other.CompareTag("AudioVolume")) { AudioVolume volume = other.GetComponent <AudioVolume>(); if (currentZone != volume.zone) { StartBlend(volume.zone); } } }
private void OnTriggerExit(Collider other) { if (other.CompareTag("AudioVolume")) { //if we want to use a default zone and the zone we are leaving is the last one we entered, blend to default AudioVolume volume = other.GetComponent <AudioVolume>(); if (currentZone == volume.zone) { if (useDefaultZone) { StartBlend(defaultZone); } else { StartBlend(lastZone); } } } }