mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-06-15 16:12:30 +08:00
refactor(UI): 调整技能图标布局并优化冷却效果
修改技能图标面板的锚点设置以改善布局 将冷却进度着色器逻辑反转并优化视觉效果 统一材质管理方式,移除重复的材质复制
This commit is contained in:
@@ -4,11 +4,10 @@ class_name SkillIcon
|
||||
@export var weapon: Weapon = null;
|
||||
|
||||
@onready var textureRect: TextureRect = $"%texture"
|
||||
|
||||
func _ready():
|
||||
textureRect.material = textureRect.material.duplicate()
|
||||
material = material.duplicate()
|
||||
func _physics_process(_delta):
|
||||
if is_instance_valid(weapon):
|
||||
textureRect.texture = weapon.avatarTexture
|
||||
var progress = min(weapon.cooldownTimer.timeSinceLastStart() / weapon.cooldownTimer.cooldown, UIState.player.energy / weapon.needEnergy)
|
||||
textureRect.material.set_shader_parameter("progress", progress)
|
||||
material.set_shader_parameter("progress", progress)
|
||||
|
||||
Reference in New Issue
Block a user