mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-06-04 18:57:13 +08:00
11 lines
351 B
GDScript
11 lines
351 B
GDScript
|
|
extends PanelContainer
|
||
|
|
|
||
|
|
@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))
|