22 lines
565 B
GDScript
22 lines
565 B
GDScript
@icon("res://addons/at-icons/node3d/backpack.svg")
|
|
class_name Backpack extends EquippableItem
|
|
|
|
@export var inventory_size: int = 10
|
|
|
|
var inventory: Array[ItemData] = []
|
|
|
|
func change_backpack_mesh(new_mesh: MeshInstance3D):
|
|
mesh = new_mesh
|
|
|
|
func change_backpack(new_backpack: Backpack):
|
|
mesh = new_backpack.mesh
|
|
inventory_size = new_backpack.inventory_size
|
|
inventory = new_backpack.inventory
|
|
|
|
func _ready() -> void:
|
|
for i in range(inventory_size):
|
|
inventory.append(null)
|
|
|
|
add_to_group("equippable")
|
|
for i in get_children():
|
|
i.add_to_group("equippable")
|