feat: 创建 upgrade 数据resource,编写upgrade_panel.gd动态生成升级卡片
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user