Fixed last bugs
This commit is contained in:
@@ -7,10 +7,16 @@ func _ready() -> void:
|
|||||||
self.onEntityInteract
|
self.onEntityInteract
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func _exit_tree() -> void:
|
||||||
|
$Entity/EntityInteractable.onInteract.disconnect(
|
||||||
|
self.onEntityInteract
|
||||||
|
)
|
||||||
|
|
||||||
func onEntityInteract(
|
func onEntityInteract(
|
||||||
interactor:EntityInteractor,
|
interactor:EntityInteractor,
|
||||||
interactee:EntityInteractable
|
interactee:EntityInteractable
|
||||||
) -> void:
|
) -> void:
|
||||||
if interactEvent == null || interactEvent.started:
|
if interactEvent == null || (interactEvent.started && !interactEvent.isDone()):
|
||||||
return
|
return
|
||||||
|
|
||||||
interactEvent.onEntityInteract(interactor, $Entity/EntityInteractable)
|
interactEvent.onEntityInteract(interactor, $Entity/EntityInteractable)
|
||||||
|
@@ -14,7 +14,6 @@ enum InteractorType {
|
|||||||
|
|
||||||
func interactWith(interactable:EntityInteractable) -> void:
|
func interactWith(interactable:EntityInteractable) -> void:
|
||||||
interactable.interact(self)
|
interactable.interact(self)
|
||||||
pass
|
|
||||||
|
|
||||||
func getRaycastInteractable() -> EntityInteractable:
|
func getRaycastInteractable() -> EntityInteractable:
|
||||||
if !entityDirection or !characterBody:
|
if !entityDirection or !characterBody:
|
||||||
|
Reference in New Issue
Block a user