feat: 创建 upgrade 数据resource,编写upgrade_panel.gd动态生成升级卡片
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
extends ItemBase
|
||||
class_name ItemUpgrade
|
||||
|
||||
@export var value: float
|
||||
@export var descriptin: String
|
||||
@export var stat_id: String
|
||||
|
||||
func apply_upgrade() -> void:
|
||||
var current_value := Global.player.stats.get(stat_id) as float
|
||||
var new_value := float(value) + float(current_value)
|
||||
Global.player.stats.set(stat_id, new_value)
|
||||
Reference in New Issue
Block a user