Sound framework improvements
This commit is contained in:
@@ -1368,12 +1368,14 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
||||
}
|
||||
}
|
||||
|
||||
if(sound != null){
|
||||
sound.update(x, y, shouldActiveSound());
|
||||
}
|
||||
if(!headless){
|
||||
if(sound != null){
|
||||
sound.update(x, y, shouldActiveSound());
|
||||
}
|
||||
|
||||
if(block.ambientSound != Sounds.none && shouldAmbientSound()){
|
||||
loops.play(block.ambientSound, self(), block.ambientSoundVolume * ambientVolume());
|
||||
if(block.ambientSound != Sounds.none && shouldAmbientSound()){
|
||||
control.sound.loop(block.ambientSound, self(), block.ambientSoundVolume * ambientVolume());
|
||||
}
|
||||
}
|
||||
|
||||
if(enabled || !block.noUpdateDisabled){
|
||||
|
||||
@@ -34,7 +34,9 @@ abstract class FireComp implements Timedc, Posc, Firec, Syncc{
|
||||
Fx.fireSmoke.at(x + Mathf.range(4f), y + Mathf.range(4f));
|
||||
}
|
||||
|
||||
loops.play(Sounds.fire, this, 0.07f);
|
||||
if(!headless){
|
||||
control.sound.loop(Sounds.fire, this, 0.07f);
|
||||
}
|
||||
|
||||
time = Mathf.clamp(time + Time.delta, 0, lifetime());
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ abstract class MinerComp implements Itemsc, Posc, Teamc, Rotc, Drawc{
|
||||
}
|
||||
|
||||
if(!headless){
|
||||
loops.play(type.mineSound, this, type.mineSoundVolume);
|
||||
control.sound.loop(type.mineSound, this, type.mineSoundVolume);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user