Add SetTimeScale node

This commit is contained in:
Lubos Lenco 2017-12-16 15:13:10 +01:00
parent cefeda105e
commit 66bada395a
3 changed files with 33 additions and 0 deletions

View file

@ -0,0 +1,14 @@
package armory.logicnode;
class SetTimeScaleNode extends LogicNode {
public function new(tree:LogicTree) {
super(tree);
}
override function run() {
var f:Float = inputs[1].get();
iron.system.Time.scale = f;
super.run();
}
}

View file

@ -13,6 +13,7 @@ class SetCameraFovNode(Node, ArmLogicTreeNode):
self.inputs.new('ArmNodeSocketAction', 'In')
self.inputs.new('ArmNodeSocketObject', 'Object')
self.inputs.new('NodeSocketFloat', 'FOV')
self.inputs[-1].default_value = 0.85
self.outputs.new('ArmNodeSocketAction', 'Out')
add_node(SetCameraFovNode, category='Action')

View file

@ -0,0 +1,18 @@
import bpy
from bpy.props import *
from bpy.types import Node, NodeSocket
from arm.logicnode.arm_nodes import *
class SetTimeScaleNode(Node, ArmLogicTreeNode):
'''Set time scale node'''
bl_idname = 'LNSetTimeScaleNode'
bl_label = 'Set Time Scale'
bl_icon = 'GAME'
def init(self, context):
self.inputs.new('ArmNodeSocketAction', 'In')
self.inputs.new('NodeSocketFloat', 'Scale')
self.inputs[-1].default_value = 1.0
self.outputs.new('ArmNodeSocketAction', 'Out')
add_node(SetTimeScaleNode, category='Action')