Update leenkx/Sources/leenkx/logicnode/SetVolumeSoundNode.hx

This commit is contained in:
Onek8 2025-04-03 12:35:51 +00:00
parent 2b1b56bc0a
commit 21c2abe67c

View File

@ -1,7 +1,7 @@
package leenkx.logicnode; package leenkx.logicnode;
#if lnx_audio
import iron.object.SpeakerObject; import iron.object.SpeakerObject;
#end
class SetVolumeSoundNode extends LogicNode { class SetVolumeSoundNode extends LogicNode {
public function new(tree: LogicTree) { public function new(tree: LogicTree) {
@ -9,9 +9,11 @@ class SetVolumeSoundNode extends LogicNode {
} }
override function run(from: Int) { override function run(from: Int) {
#if lnx_audio
var object: SpeakerObject = cast(inputs[1].get(), SpeakerObject); var object: SpeakerObject = cast(inputs[1].get(), SpeakerObject);
if (object == null) return; if (object == null) return;
object.setVolume(inputs[2].get()); object.setVolume(inputs[2].get());
#end
runOutput(0); runOutput(0);
} }
} }