1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-30 07:51:54 +08:00
Files
Dog-Lynx-And-HCN/scripts/Statemachine/SkillIcon.gd
T

15 lines
470 B
GDScript
Raw Normal View History

extends PanelContainer
2025-09-06 15:24:50 +08:00
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)