Changed to vehicle sensor instead of single sensor types
This commit is contained in:
@@ -6,16 +6,27 @@ var used_sensors: Dictionary = {}
|
||||
|
||||
var host_vehicle: VehicleNode
|
||||
|
||||
var timer: float = 0.
|
||||
static var timer_1_60: float = 1/60
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
Signals.vehicle_added.connect(_on_vehicle_added)
|
||||
Signals.requested_host_vehicle.emit(self)
|
||||
|
||||
func _process(delta: float):
|
||||
timer += delta
|
||||
if host_vehicle != null:
|
||||
if timer < timer_1_60:
|
||||
return
|
||||
timer = 0
|
||||
_update_data()
|
||||
return
|
||||
Signals.requested_host_vehicle.emit(self)
|
||||
|
||||
func _update_data():
|
||||
pass
|
||||
|
||||
func _on_vehicle_added(new_vehicle):
|
||||
host_vehicle = new_vehicle
|
||||
|
||||
|
||||
Reference in New Issue
Block a user