item
This commit is contained in:
21
scripts/Entity/ItemOnGround.gd
Normal file
21
scripts/Entity/ItemOnGround.gd
Normal file
@@ -0,0 +1,21 @@
|
||||
class_name ItemOnGround extends StaticBody3D
|
||||
|
||||
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:
|
||||
ITEM.PLAYER_INVENTORY.addItem(ITEM.ONION);
|
||||
|
||||
# Dispose self
|
||||
get_parent().remove_child(self)
|
||||
self.queue_free()
|
Reference in New Issue
Block a user