person can take and interact with item

This commit is contained in:
Nikolai Fesenko
2025-08-19 13:58:34 +02:00
parent e4667a3a47
commit 31c9a69132
9 changed files with 97 additions and 36 deletions

View File

@@ -6,35 +6,28 @@ var test: bool = false
func _init() -> void:
max_person_using = 1
can_store = true
print("init")
func _ready() -> void:
self.owner = $".."
print(self)
#object_placed.connect(_on_object_placed.bind(self))
print("ready")
func start_action(person, object):
pass
if person.target_action == "take":
give_out(person)
func give_out(person):
pass
person.hold_item(person.target_item)
stored_items.erase(person.target_item)
func _on_object_placed(_owner):
print(2)
print(_owner)
var newItem = ItemManager.get_item(0).instantiate()
ItemManager.add_shelf(_owner)
#ItemManager.shelfes.append(_owner)
ItemManager.add_item_to_shelf(_owner, newItem)
print("placed")
func create():
var newItem = ItemManager.get_item(0).instantiate()
ItemManager.shelfes.append(self)
ItemManager.add_shelf(self)
ItemManager.add_item_to_shelf(self, newItem)
print("placed")