2025-01-22 16:18:30 +01:00
|
|
|
package leenkx.logicnode;
|
2025-04-03 12:35:51 +00:00
|
|
|
#if lnx_audio
|
2025-01-22 16:18:30 +01:00
|
|
|
import iron.object.SpeakerObject;
|
2025-04-03 12:35:51 +00:00
|
|
|
#end
|
2025-01-22 16:18:30 +01:00
|
|
|
class SetVolumeSoundNode extends LogicNode {
|
|
|
|
|
|
|
|
public function new(tree: LogicTree) {
|
|
|
|
super(tree);
|
|
|
|
}
|
|
|
|
|
|
|
|
override function run(from: Int) {
|
2025-04-03 12:35:51 +00:00
|
|
|
#if lnx_audio
|
2025-01-22 16:18:30 +01:00
|
|
|
var object: SpeakerObject = cast(inputs[1].get(), SpeakerObject);
|
|
|
|
if (object == null) return;
|
|
|
|
object.setVolume(inputs[2].get());
|
2025-04-03 12:35:51 +00:00
|
|
|
#end
|
2025-01-22 16:18:30 +01:00
|
|
|
runOutput(0);
|
|
|
|
}
|
|
|
|
}
|