This commit is contained in:
Overside srl
2026-02-16 07:19:27 +01:00
parent 5843e8a07a
commit 65bb24ff6a
121 changed files with 184941 additions and 185064 deletions

View File

@@ -1,10 +1,10 @@
extends Area3D
class_name RailSwitch
@export var rail_a: Path3D
@export var rail_b: Path3D
@export var switch_to_rail: Path3D # Il binario verso cui deviare
# Cambia direzione dello scambio
func toggle_switch() -> void:
if switch_to_rail == rail_a:
@@ -12,6 +12,6 @@ func toggle_switch() -> void:
else:
switch_to_rail = rail_a
func _on_body_entered(body: Node3D) -> void:
if body is Train:
body.switch_to_rail(switch_to_rail)
func get_state_name() -> String:
return "BINARIO 1" if switch_to_rail == rail_b else "BINARIO 2"