21 lines
439 B
Haxe
21 lines
439 B
Haxe
package leenkx.logicnode;
|
|
#if lnx_audio
|
|
import iron.object.SpeakerObject;
|
|
#end
|
|
class SetSoundNode 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);
|
|
var sound: String = inputs[2].get();
|
|
if (object == null || sound == null) return;
|
|
object.setSound(sound);
|
|
#end
|
|
runOutput(0);
|
|
}
|
|
}
|