add child node assertions to units

This commit is contained in:
2024-10-06 07:26:55 +10:00
parent 130c013a38
commit f63689ca89
2 changed files with 8 additions and 0 deletions

View File

@@ -9,6 +9,9 @@ var ground_plane: Plane = Plane(Vector3.UP, 0)
func _ready() -> void:
assert(camera != null, "camera missing!")
assert(selection_sprite != null, "selection_sprite missing!")
set_selected(false)
super._ready()

View File

@@ -16,6 +16,11 @@ var is_on_screen: bool = false
func _ready() -> void:
assert(hover_sprite != null, "hover_sprite missing!")
assert(nav_agent != null, "nav_agent missing!")
assert(animation_player != null, "animation_player missing!")
assert(visibility_notifier != null, "visibility_notifier missing!")
set_hovered(false)
nav_agent.max_speed = MOVE_SPEED
nav_agent.velocity_computed.connect(_on_nav_agent_velocity_computed)