@tool
extends Node2D
class_name Mask

@export var mask_resource: MaskResource:
	set(new_resource):
		mask_resource = new_resource
		_on_mask_resource_changed()
		
@onready var mask_sprite: Sprite2D = $MaskSprite


func _on_mask_resource_changed() -> void:
	if mask_resource == null:
		mask_sprite.visible = false
		return
	if mask_sprite != null:
		mask_sprite.visible = true
		mask_sprite.texture = mask_resource.mask_sprite
	
