feat: 创建 upgrade 数据resource,编写upgrade_panel.gd动态生成升级卡片

This commit is contained in:
luke358
2026-05-21 16:04:27 +08:00
parent ce3813c5dc
commit 1796d9e47d
14 changed files with 170 additions and 17 deletions
+11 -6
View File
@@ -1,11 +1,16 @@
extends Panel
class_name UpgradeCard
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
@export var item_data: ItemUpgrade: set = _set_data
@onready var item_icon: TextureRect = %Icon
@onready var item_name: Label = %Name
@onready var item_description: Label = %Description
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func _set_data(value: ItemUpgrade) -> void:
item_data = value
item_icon.texture = item_data.item_icon
item_name.text = item_data.item_name
item_description.text = item_data.descriptin