Sign test
This commit is contained in:
22
scripts/Entity/Sign.gd
Normal file
22
scripts/Entity/Sign.gd
Normal file
@@ -0,0 +1,22 @@
|
||||
class_name Sign extends StaticBody3D
|
||||
|
||||
@export var interactEvent:Event = null
|
||||
|
||||
func _ready() -> void:
|
||||
$Entity/EntityInteractable.onInteract.connect(
|
||||
self.onEntityInteract
|
||||
)
|
||||
|
||||
func _exit_tree() -> void:
|
||||
$Entity/EntityInteractable.onInteract.disconnect(
|
||||
self.onEntityInteract
|
||||
)
|
||||
|
||||
func onEntityInteract(
|
||||
interactor:EntityInteractor,
|
||||
interactee:EntityInteractable
|
||||
) -> void:
|
||||
if interactEvent == null || (interactEvent.started && !interactEvent.isDone()):
|
||||
return
|
||||
|
||||
interactEvent.onEntityInteract(interactor, $Entity/EntityInteractable)
|
1
scripts/Entity/Sign.gd.uid
Normal file
1
scripts/Entity/Sign.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bitykguiignfu
|
Reference in New Issue
Block a user