Update leenkx/Sources/leenkx/logicnode/SetSoundNode.hx
This commit is contained in:
parent
9e47c1db6d
commit
2b1b56bc0a
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user