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,9 +0,0 @@
extends PathFollow3D
#class_name TrainEngine
#
#@onready var train: MeshInstance3D = $"../../Train"
#
#
#func _physics_process(delta: float) -> void:
#if train:
#progress += train.current_speed * delta

View File

@@ -1 +0,0 @@
uid://ck4j0pekoofm1

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"

View File

@@ -1 +1 @@
uid://bhan6tvt4sow
uid://b5x80gpkn1swt

View File

@@ -1,17 +0,0 @@
extends Area3D
@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:
switch_to_rail = rail_b
else:
switch_to_rail = rail_a
#func get_state_name() -> String:
#return "BIANRIO 1" if current_state == SwitchState.LEFT else "BINARIO 2"

View File

@@ -1 +0,0 @@
uid://b5x80gpkn1swt

View File

@@ -9,6 +9,10 @@ extends Node3D
@onready var switch_label : Label = $HUD/switch_label
func _ready() -> void:
_update_switch_status()
func _process(_delta: float) -> void:
_update_ui()
@@ -31,17 +35,16 @@ func _update_ui() -> void:
func _toggle_rail() -> void:
if train and rail_switch:
rail_switch.toggle_switch()
train.switch_to_rail(rail_switch.switch_to_rail)
#train.switch_to_rail(rail_switch.switch_to_rail)
#_update_switch_status()
func _update_switch_status():
if not switch_label:
return
#if rail_switch:
#var state_name = rail_switch.get_state_name()
#var color = Color.YELLOW if rail_switch.current_state == rail_switch.SwitchState.LEFT else Color.CYAN
#switch_label.text = "Scambio: %s" % state_name
#switch_label.add_theme_color_override("font_color", color)
#else:
#switch_label.text = "Scambio: N/A"
if rail_switch:
var state_name = rail_switch.get_state_name()
switch_label.text = "Scambio: %s" % state_name
else:
switch_label.text = "Scambio: N/A"