Version: 5.4
public float spread ;

説明

3D ステレオが広がる角度 (度単位)かスピーカー空間のマルチチャンネルを設定します。

0 はすべてのサウンドチャネルが同じスピーカーの位置にあり、'モノラル'です。360 はすべてのサブチャンネルが 3D の位置にあるべきスピーカーの位置と反対側のスピーカー位置に配置されます。デフォルトは 0 です。

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { 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; } }