virtual_joystick_instantiator.gd 540 B

1234567891011121314151617
  1. @tool
  2. extends Control
  3. var scene
  4. func _enter_tree():
  5. scene = preload("res://addons/virtual_joystick/virtual_joystick_scene.tscn").instantiate()
  6. add_child(scene)
  7. if ProjectSettings.get_setting("input_devices/pointing/emulate_mouse_from_touch"):
  8. printerr("The Project Setting 'emulate_mouse_from_touch' should be set to False")
  9. if not ProjectSettings.get_setting("input_devices/pointing/emulate_touch_from_mouse"):
  10. printerr("The Project Setting 'emulate_touch_from_mouse' should be set to True")
  11. func _exit_tree():
  12. scene.free()