我需要根据 X 爆炸坐标播放声音平移。
Vector2 PositionOfExplosion = ExplosionCoord;
myScreenWidth = 480; //Windows phone
float SoundPan = ??? //Mus be something like MathHelper.Clamp(???, -1, 1);
_explosion1.Play(myVolumen, myPitch, SoundPan); // Pan from -1.0 left to 1.0 right. 0 is center
恢复,
如果发生爆炸
X=0 Pan= -1
...
X=120 Pan= -0.5
...
X=240 Pan= 0
...
x=360 Pan = 0.5
...
x=480 Pan= 1
对不起我的英语。
谢谢。