working with level changes and money deposits
This commit is contained in:
@@ -3,6 +3,8 @@ extends Node
|
||||
signal room_entered()
|
||||
signal room_exited()
|
||||
|
||||
@export var one_way = false
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
add_to_group("room_check")
|
||||
@@ -13,8 +15,9 @@ func _process(delta: float) -> void:
|
||||
|
||||
func _on_body_entered(body: Node3D) -> void:
|
||||
if body.is_in_group("player"):
|
||||
emit_signal("room_entered")
|
||||
get_parent().room_entered()
|
||||
|
||||
func _on_body_exited(body: Node3D) -> void:
|
||||
if body.is_in_group("player"):
|
||||
emit_signal("room_exited")
|
||||
if !one_way:
|
||||
if body.is_in_group("player"):
|
||||
get_parent().room_exited()
|
||||
|
||||
Reference in New Issue
Block a user