mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 23:11:54 +08:00
77f3d5e4a1
- 移除进度值的clamp限制,允许超出范围效果 - 为冷却进度着色器添加边缘高光和拖尾效果 - 调整图标容器圆角和最小尺寸 - 更新材质参数以支持新的着色器效果
15 lines
470 B
GDScript
15 lines
470 B
GDScript
extends PanelContainer
|
|
class_name SkillIcon
|
|
|
|
@export var weapon: Weapon = null;
|
|
|
|
@onready var textureRect: TextureRect = $"%texture"
|
|
|
|
func _ready():
|
|
textureRect.material = textureRect.material.duplicate()
|
|
func _physics_process(_delta):
|
|
if is_instance_valid(weapon):
|
|
textureRect.texture = weapon.avatarTexture
|
|
var progress = weapon.cooldownTimer.timeSinceLastStart() / weapon.cooldownTimer.cooldown
|
|
textureRect.material.set_shader_parameter("progress", progress)
|