mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2026-04-27 05:01:38 +00:00
fix persisting loud sounds
This commit is contained in:
parent
92d59ec1b6
commit
b7652955b5
4 changed files with 16 additions and 0 deletions
|
|
@ -33,6 +33,7 @@ class DuctFan extends ForceObject {
|
||||||
ResourceLoader.load("sound/fan_loop.wav").entry.load(() -> {
|
ResourceLoader.load("sound/fan_loop.wav").entry.load(() -> {
|
||||||
this.soundChannel = AudioManager.playSound(ResourceLoader.getResource("data/sound/fan_loop.wav", ResourceLoader.getAudio,
|
this.soundChannel = AudioManager.playSound(ResourceLoader.getResource("data/sound/fan_loop.wav", ResourceLoader.getAudio,
|
||||||
this.soundResources), new Vector(1e8, 1e8, 1e8), true);
|
this.soundResources), new Vector(1e8, 1e8, 1e8), true);
|
||||||
|
this.soundChannel.pause = true;
|
||||||
onFinish();
|
onFinish();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
@ -43,5 +44,8 @@ class DuctFan extends ForceObject {
|
||||||
|
|
||||||
var seffect = this.soundChannel.getEffect(Spatialization);
|
var seffect = this.soundChannel.getEffect(Spatialization);
|
||||||
seffect.position = this.getAbsPos().getPosition();
|
seffect.position = this.getAbsPos().getPosition();
|
||||||
|
|
||||||
|
if (this.soundChannel.pause)
|
||||||
|
this.soundChannel.pause = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ class Magnet extends ForceObject {
|
||||||
ResourceLoader.load("sound/magnet.wav").entry.load(() -> {
|
ResourceLoader.load("sound/magnet.wav").entry.load(() -> {
|
||||||
this.soundChannel = AudioManager.playSound(ResourceLoader.getResource("data/sound/magnet.wav", ResourceLoader.getAudio, this.soundResources),
|
this.soundChannel = AudioManager.playSound(ResourceLoader.getResource("data/sound/magnet.wav", ResourceLoader.getAudio, this.soundResources),
|
||||||
new Vector(1e8, 1e8, 1e8), true);
|
new Vector(1e8, 1e8, 1e8), true);
|
||||||
|
this.soundChannel.pause = true;
|
||||||
onFinish();
|
onFinish();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
@ -44,5 +45,8 @@ class Magnet extends ForceObject {
|
||||||
|
|
||||||
var seffect = this.soundChannel.getEffect(Spatialization);
|
var seffect = this.soundChannel.getEffect(Spatialization);
|
||||||
seffect.position = this.getAbsPos().getPosition();
|
seffect.position = this.getAbsPos().getPosition();
|
||||||
|
|
||||||
|
if (this.soundChannel.pause)
|
||||||
|
this.soundChannel.pause = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ class SmallDuctFan extends ForceObject {
|
||||||
ResourceLoader.load("sound/fan_loop.wav").entry.load(() -> {
|
ResourceLoader.load("sound/fan_loop.wav").entry.load(() -> {
|
||||||
this.soundChannel = AudioManager.playSound(ResourceLoader.getResource("data/sound/fan_loop.wav", ResourceLoader.getAudio,
|
this.soundChannel = AudioManager.playSound(ResourceLoader.getResource("data/sound/fan_loop.wav", ResourceLoader.getAudio,
|
||||||
this.soundResources), new Vector(1e8, 1e8, 1e8), true);
|
this.soundResources), new Vector(1e8, 1e8, 1e8), true);
|
||||||
|
this.soundChannel.pause = true;
|
||||||
onFinish();
|
onFinish();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
@ -43,5 +44,8 @@ class SmallDuctFan extends ForceObject {
|
||||||
|
|
||||||
var seffect = this.soundChannel.getEffect(Spatialization);
|
var seffect = this.soundChannel.getEffect(Spatialization);
|
||||||
seffect.position = this.getAbsPos().getPosition();
|
seffect.position = this.getAbsPos().getPosition();
|
||||||
|
|
||||||
|
if (this.soundChannel.pause)
|
||||||
|
this.soundChannel.pause = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,7 @@ class Tornado extends ForceObject {
|
||||||
ResourceLoader.load("sound/tornado.wav").entry.load(() -> {
|
ResourceLoader.load("sound/tornado.wav").entry.load(() -> {
|
||||||
this.soundChannel = AudioManager.playSound(ResourceLoader.getResource("data/sound/tornado.wav", ResourceLoader.getAudio, this.soundResources),
|
this.soundChannel = AudioManager.playSound(ResourceLoader.getResource("data/sound/tornado.wav", ResourceLoader.getAudio, this.soundResources),
|
||||||
new Vector(1e8, 1e8, 1e8), true);
|
new Vector(1e8, 1e8, 1e8), true);
|
||||||
|
this.soundChannel.pause = true;
|
||||||
for (material in this.materials) {
|
for (material in this.materials) {
|
||||||
material.blendMode = Alpha;
|
material.blendMode = Alpha;
|
||||||
// material.mainPass.culling = h3d.mat.Data.Face.None;
|
// material.mainPass.culling = h3d.mat.Data.Face.None;
|
||||||
|
|
@ -64,5 +65,8 @@ class Tornado extends ForceObject {
|
||||||
|
|
||||||
var seffect = this.soundChannel.getEffect(Spatialization);
|
var seffect = this.soundChannel.getEffect(Spatialization);
|
||||||
seffect.position = this.getAbsPos().getPosition();
|
seffect.position = this.getAbsPos().getPosition();
|
||||||
|
|
||||||
|
if (this.soundChannel.pause)
|
||||||
|
this.soundChannel.pause = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue