2025-01-22 16:18:30 +01:00

20 lines
760 B
Python

from lnx.logicnode.lnx_nodes import *
class FloatNode(LnxLogicVariableNodeMixin, LnxLogicTreeNode):
"""Stores the given float as a variable. If the set float value has more
than 3 decimal places, the displayed value in the node will be
rounded, but when you click on it you can still edit the exact
value which will be used in the game as well."""
bl_idname = 'LNFloatNode'
bl_label = 'Float'
lnx_version = 1
def lnx_init(self, context):
self.add_input('LnxFloatSocket', 'Float In')
self.add_output('LnxFloatSocket', 'Float Out', is_var=True)
def synchronize_from_master(self, master_node: LnxLogicVariableNodeMixin):
self.inputs[0].default_value_raw = master_node.inputs[0].get_default_value()