mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-30 07:51:54 +08:00
4d8969c47d
在UI中添加技能图标容器,并为每个武器创建对应的技能图标 初始化武器冷却计时器,修复武器冷却时间未设置的问题
12 lines
372 B
GDScript
12 lines
372 B
GDScript
extends PanelContainer
|
|
class_name SkillIcon
|
|
|
|
@export var weapon: Weapon = null;
|
|
|
|
@onready var textureRect = $"%texture"
|
|
|
|
func _physics_process(_delta):
|
|
if is_instance_valid(weapon):
|
|
textureRect.texture = weapon.avatarTexture
|
|
textureRect.material.set_shader_parameter("progress", clamp(weapon.cooldownTimer.timeSinceLastStart() / weapon.cooldownTimer.cooldown, 0, 1))
|