ajout du détecteur et liaison entre les scènes
This commit is contained in:
19
entities/interactables/door/script/door.gd
Normal file
19
entities/interactables/door/script/door.gd
Normal file
@@ -0,0 +1,19 @@
|
||||
@tool
|
||||
extends Interactable
|
||||
class_name Door
|
||||
|
||||
@export var to_scene_id = ""
|
||||
|
||||
func _ready():
|
||||
modulate = Color.WHITE if available else Color.RED
|
||||
|
||||
func interact(_p : Player) -> bool:
|
||||
if available and to_scene_id:
|
||||
interacted.emit(_p)
|
||||
SceneManager.change_to_scene_id(to_scene_id)
|
||||
|
||||
return available
|
||||
|
||||
func set_available(v : bool):
|
||||
available = v
|
||||
modulate = Color.WHITE if available else Color.RED
|
||||
1
entities/interactables/door/script/door.gd.uid
Normal file
1
entities/interactables/door/script/door.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bmxuqj0c6h60d
|
||||
Reference in New Issue
Block a user