mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-27 22:41:56 +08:00
2bb4658968
将技能图标粒子发射条件从进度满改为武器可攻击状态,并添加酸风武器和HXD武器到角色武器库
24 lines
662 B
GDScript
24 lines
662 B
GDScript
extends PanelContainer
|
|
class_name SkillIcon
|
|
|
|
@export var weapon: Weapon = null;
|
|
|
|
@onready var textureRect: TextureRect = $"%texture"
|
|
@onready var particle: GPUParticles2D = $"%particle"
|
|
|
|
var showed: bool = false
|
|
|
|
func _ready():
|
|
material = material.duplicate()
|
|
func _physics_process(_delta):
|
|
if is_instance_valid(weapon):
|
|
textureRect.texture = weapon.avatarTexture
|
|
var progress = min(weapon.cooldownTimer.percent(), UIState.player.fillingProgress(weapon.needEnergy))
|
|
material.set_shader_parameter("progress", progress)
|
|
particle.emitting = weapon.canAttackBy(UIState.player)
|
|
if progress >= 1:
|
|
if !showed:
|
|
showed = true
|
|
else:
|
|
showed = false
|