class_name ItemPickup
extends Interactable


# Declare member variables here. Examples:
# var a = 2
# var b = "text"
export var item :Resource
export var count :int = 1




# Called when the node enters the scene tree for the first time.
func _ready():
	assert( item is Item, "Proper Item resourse type not given " + self.name)
	if item is Item:
		if item.in_game_sprite != null:
			var anim_sprite = AnimatedSprite.new()
			anim_sprite.frames = item.in_game_sprite
			add_child(anim_sprite)
			anim_sprite.play()
		elif item.inventory_icon != null:
			var sprite = Sprite.new()
			sprite.texture = item.inventory_icon
			add_child(sprite)

func trigger_interaction():
	queue_free()

# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
#	pass
