1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-06-05 03:07:12 +08:00
Files
Dog-Lynx-And-HCN/scripts/Statemachine/SkillIcon.gd
T
fallingshrimp 234a632f39 refactor(UI): 调整技能图标布局并优化冷却效果
修改技能图标面板的锚点设置以改善布局
将冷却进度着色器逻辑反转并优化视觉效果
统一材质管理方式,移除重复的材质复制
2025-09-10 06:31:53 +08:00

14 lines
481 B
GDScript

extends PanelContainer
class_name SkillIcon
@export var weapon: Weapon = null;
@onready var textureRect: TextureRect = $"%texture"
func _ready():
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)
material.set_shader_parameter("progress", progress)