armory/Sources/armory/logicnode/PlaySoundNode.hx

18 lines
331 B
Haxe
Raw Normal View History

2017-04-08 00:34:45 +02:00
package armory.logicnode;
2017-11-20 15:16:52 +01:00
import iron.object.SpeakerObject;
2017-04-08 00:34:45 +02:00
2017-04-08 20:05:35 +02:00
class PlaySoundNode extends LogicNode {
2017-04-08 00:34:45 +02:00
public function new(tree:LogicTree) {
super(tree);
}
2018-10-22 10:10:33 +02:00
override function run(from:Int) {
2017-04-08 00:34:45 +02:00
var object:SpeakerObject = cast(inputs[1].get(), SpeakerObject);
2018-06-14 14:52:05 +02:00
if (object == null) return;
2017-04-08 00:34:45 +02:00
object.play();
2018-10-22 10:10:33 +02:00
runOutput(0);
2017-04-08 00:34:45 +02:00
}
}