feat: add simulation garden demo controls

This commit is contained in:
2026-07-07 15:56:24 +02:00
parent b0bad6c467
commit 4bfc09d5f6
9 changed files with 124 additions and 6 deletions
+9
View File
@@ -19,6 +19,7 @@ static var _all: Array[ResourceNode] = []
@export var comfort_distance := 18.0
@export var discovery_priority := 0.0
@export var hide_visual_when_depleted: bool = false
@export var debug_label_enabled := true
@onready var interaction_point: Marker3D = $InteractionPoint
@@ -121,6 +122,9 @@ func _update_presentation() -> void:
if not has_node("DebugLabel"):
return
var label := $DebugLabel as Label3D
label.visible = debug_label_enabled
if not debug_label_enabled:
return
var text := "%s\n%s %.1f" % [node_id, resource_id, get_amount_remaining()]
if state != null:
text += "\nrisk:%.2f comfort:%.0f" % [state.get_safety_risk(), state.get_comfort_distance()]
@@ -133,6 +137,11 @@ func _update_presentation() -> void:
label.text = text
func set_debug_label_enabled(is_enabled: bool) -> void:
debug_label_enabled = is_enabled
_update_presentation()
static func get_by_id(search_id: StringName) -> ResourceNode:
for node in _all:
if node.node_id == search_id: