Add SetTimeScale node
This commit is contained in:
parent
cefeda105e
commit
66bada395a
14
Sources/armory/logicnode/SetTimeScaleNode.hx
Normal file
14
Sources/armory/logicnode/SetTimeScaleNode.hx
Normal 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();
|
||||
}
|
||||
}
|
|
@ -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')
|
||||
|
|
18
blender/arm/logicnode/action_set_time_scale.py
Normal file
18
blender/arm/logicnode/action_set_time_scale.py
Normal 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')
|
Loading…
Reference in a new issue