Added Itemsmanager
Items now can be stored. I wanna kill myself
This commit is contained in:
40
Scripts/objects/shelf_object.gd
Normal file
40
Scripts/objects/shelf_object.gd
Normal file
@@ -0,0 +1,40 @@
|
||||
extends Interactable
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
func give_out(person):
|
||||
pass
|
||||
|
||||
|
||||
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_item_to_shelf(self, newItem)
|
||||
print("placed")
|
||||
Reference in New Issue
Block a user