找回密碼
 注冊帳號

掃一掃,訪問微社區

audiochorusfilter.pan 平衡調整

2015-1-3 13:47| 發布者: 楊炎| 查看: 2555| 評論: 0|原作者: 蠻牛|來自: unity3d腳本manual

摘要: audiosource.pan 平衡調整varpan: floatdescription描述sets a channels pan position linearly. only works for 2d clips.設置一個通道平衡調整線性位置,只工作于2d剪輯。-1.0 to 1.0. -1.0 is full left. 0.0 is ...

audiosource.pan 平衡調整

varpan: float

description描述

sets a channels pan position linearly. only works for 2d clips.

設置一個通道平衡調整線性位置,只工作于2d剪輯。

-1.0 to 1.0. -1.0 is full left. 0.0 is center. 1.0 is full right. only sounds that are mono or stereo can be panned. multichannel sounds (ie >2 channels) cannot be panned.

-1.0到1.0。-1.0是最左,0.0為中間,1.0是最右。只有聲音是單聲道或立體聲可以被調整。多聲道聲音(大于2聲道)不能被調整。

c#

javascript

using unityengine;

using system.collections;

public class example :monobehaviour{

public bool panonleft = false;

void update() {

if (input.getkeydown(keycode.space))

if (panonleft) {

panonleft = false;

audio.pan = 1;

} else {

panonleft = true;

audio.pan = -1;

}

}

void awake() {

audio.pan = 1;

}

}

// switches sound from left to right everytime the user presses space

//在用戶每次按下空格鍵,從左到右聲道切換聲音

var panonleft = false;

audio.pan = 1;

function update() {

if(input.getkeydown(keycode.space)) {

if(panonleft) {

panonleft = false;

audio.pan = 1;

} else {

panonleft = true;

audio.pan = -1;

}

}

}

相關閱讀

文章點評
相關文章
女校游泳队彩金