mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-29 07:21:54 +08:00
6d96c158bb
- 为技能图标添加粒子效果,在冷却完成时显示 - 调整冷却进度条的着色器参数,改进视觉效果 - 修改默认游戏难度为MASTER - 重构UI布局,将技能图标整合到能量条容器中 - 调整实体升级公式,使用平方根计算难度加成
24 lines
669 B
GDScript
24 lines
669 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.timeSinceLastStart() / weapon.cooldownTimer.cooldown, UIState.player.energy / weapon.needEnergy)
|
|
material.set_shader_parameter("progress", progress)
|
|
if progress >= 1:
|
|
if !showed:
|
|
showed = true
|
|
particle.emitting = true
|
|
else:
|
|
showed = false
|