mirror of
https://codeberg.org/sunder/sunder.git
synced 2026-07-09 02:44:32 +00:00
23 lines
526 B
GDScript
23 lines
526 B
GDScript
class_name Inventory extends Node3D
|
|
|
|
# weapons, tuple of 3 unique weapons
|
|
# flag, object
|
|
# grenades, typed array of max 2 grenade resources
|
|
|
|
@export_range(-1, 2) var cursor: int = -1
|
|
|
|
@export var loadout:Loadout
|
|
|
|
@onready var weapons:Node3D = $Weapons
|
|
|
|
func _ready() -> void:
|
|
if loadout and multiplayer.is_server():
|
|
for weapon in loadout.weapons:
|
|
weapons.add_child(weapon.instantiate())
|
|
|
|
#func _on_primary() -> void:
|
|
#equipped.trigger()
|
|
|
|
func clear() -> void:
|
|
for child in weapons.get_children():
|
|
child.queue_free()
|