Update leenkx/Sources/leenkx/logicnode/SetSoundNode.hx

This commit is contained in:
Onek8 2025-04-03 12:35:02 +00:00
parent 9e47c1db6d
commit 2b1b56bc0a

View File

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