public float spread ;

Description

Устанавливает для угла раскрытия режим 3d стерео или мультиканальный звук в пространстве динамиков.

0 = все звуковые каналы располагаются в одном динамике и будут 'моно'. 360 = все субканалы располагаются в противоположном динамике по отношению к положению динамика, соответствующему 3D позиции. По умолчанию = 0.

using UnityEngine;

public class Example : MonoBehaviour { // when any AudioSource goes trough this transform, it will set it as 'mono' // and will restore the value to 3D effect after exiting // Make sure the audio source has a collider. void OnTriggerEnter(Collider other) { AudioSource audio = other.GetComponent<AudioSource>();

if (audio) { audio.spread = 0; } }

void OnTriggerExit(Collider other) { AudioSource audio = other.GetComponent<AudioSource>();

if (audio) { audio.spread = 360; } } }