找回密码
 注册帐号

扫一扫,访问微社区

audiochorusfilter.spread 扩散

2015-1-3 15:27| 发布者: 杨炎| 查看: 2023| 评论: 0|原作者: 蛮牛|来自: unity3d脚本manual

摘要: audiosource.spread 扩散varspread: floatdescription描述sets the spread angle a 3d stereo or multichannel sound in speaker space.设置3d stereo的扩散角或扬声器空间的多声道声音。0 = all sound channels are ...

audiosource.spread 扩散

varspread: float

description描述

sets the spread angle a 3d stereo or multichannel sound in speaker space.

设置3d stereo的扩散角或扬声器空间的多声道声音。

0 = all sound channels are located at the same speaker location and is 'mono'. 360 = all subchannels are located at the opposite speaker location to the speaker location that it should be according to 3d position. default = 0.

0=所有声音通道位于相同的扬声器位置并且是单声道。360=所有子通道位于对面扬声器的位置到扬声器位置,这应该根据3d位置。默认为0。

c#

javascript

using unityengine;

using system.collections;

public class example :monobehaviour{

void ontriggerenter(colliderother) {

if (other.audio)

other.audio.spread = 0;

}

void ontriggerexit(colliderother) {

if (other.audio)

other.audio.spread = 360;

}

}

// 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.

//当任意audiosource通过这个变换,将设置它为单通道,并且退出后恢复值到3d效果

//确定音频源有一个碰撞

function ontriggerenter(other :collider) {

if(other.audio)

other.audio.spread = 0;

}

function ontriggerexit(other :collider) {

if(other.audio)

other.audio.spread = 360;

}

相关阅读

文章点评
相关文章