SFX changes

This commit is contained in:
Anuken
2020-11-08 13:55:09 -05:00
parent 0a67576133
commit a211fceab4
36 changed files with 80 additions and 142 deletions

View File

@@ -31,12 +31,12 @@ public class LoopControl{
boolean play = data.curVolume > 0.01f;
float pan = Mathf.zero(data.total, 0.0001f) ? 0f : sound.calcPan(data.sum.x / data.total, data.sum.y / data.total);
if(data.soundID <= 0){
if(data.soundID <= 0 || !sound.isPlaying(data.soundID)){
if(play){
data.soundID = sound.loop(data.curVolume, 1f, pan);
}
}else{
if(data.curVolume <= 0.01f){
if(data.curVolume <= 0.001f){
sound.stop();
data.soundID = -1;
return;