31 lines
648 B
GDScript
31 lines
648 B
GDScript
@tool
|
|
extends Node
|
|
|
|
var simu_Started
|
|
@onready var conveyor: BeltConveyorAssembly = $"../FL4066_2"
|
|
@onready var boxSpawn: BoxSpawner = $"../BoxSpawner"
|
|
|
|
func _enter_tree() -> void:
|
|
SimulationEvents.simulation_started.connect(_simulation_started)
|
|
SimulationEvents.simulation_ended.connect(_simulation_ended)
|
|
|
|
func _simulation_started() -> void:
|
|
print("Simulation Started !")
|
|
simu_Started = true
|
|
|
|
func _simulation_ended():
|
|
print("Simulation Ended")
|
|
simu_Started = false
|
|
|
|
|
|
func _physics_process(delta: float) -> void:
|
|
if (!simu_Started): return
|
|
|
|
if(conveyor.speed == 0):
|
|
boxSpawn.disable = true
|
|
else:
|
|
boxSpawn.disable = false
|
|
|
|
|
|
|