1
Fork 0
mirror of https://github.com/Steffo99/hella-farm.git synced 2024-11-28 02:54:24 +00:00
hella-farm/behaviours/move.gd

23 lines
434 B
GDScript3
Raw Normal View History

@icon("res://behaviours/move.svg")
extends Node2D
class_name Move
signal move(norm: Vector2)
2024-04-17 03:01:02 +00:00
signal move_toggled(value: bool)
signal move_enabled
signal move_disabled
## Whether this component should emit [signal move].
2024-04-17 03:01:02 +00:00
@export var enabled: bool = true:
get:
return enabled
set(value):
if enabled != value:
enabled = value
move_toggled.emit(value)
if value:
move_enabled.emit()
else:
move_disabled.emit()