extends Control

class_name CollectibleUI

var collectible_resource: CollectibleResource

@onready var texture_rect: TextureRect = $%CollectibleTexture

func setup(collectible: CollectibleResource) -> void:
	collectible_resource = collectible
	if collectible.image:
		if !texture_rect:
			texture_rect = $%CollectibleTexture
		texture_rect.texture = collectible_resource.image

func unlock() -> void:
	if !texture_rect:
		texture_rect = $%CollectibleTexture
	texture_rect.set_modulate(Color(1,1,1,1))
