Files
LNXSDK/leenkx/Sources/leenkx/logicnode/PlaySoundNode.hx

20 lines
374 B
Haxe

package leenkx.logicnode;
#if lnx_audio
import iron.object.SpeakerObject;
#end
class PlaySoundNode extends LogicNode {
public function new(tree: LogicTree) {
super(tree);
}
override function run(from: Int) {
#if lnx_audio
var object: SpeakerObject = cast(inputs[1].get(), SpeakerObject);
if (object == null) return;
object.play();
#end
runOutput(0);
}
}