mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-29 07:21:54 +08:00
e4d04ff599
- 新增 SkillIcon.gd 脚本用于管理武器技能图标显示 - 修改 CooldownProgress.gdshader 增加背景透明度参数 - 更新 CooldownTimer.gd 添加时间计算方法 - 重构 SkillIconBase.tscn 场景以支持新功能
15 lines
312 B
GDScript
15 lines
312 B
GDScript
class_name CooldownTimer
|
|
|
|
var cooldown: float = 100
|
|
var lastStart: int = 0
|
|
|
|
func isCooldowned():
|
|
return timeSinceLastStart() >= cooldown
|
|
func start():
|
|
var state = isCooldowned()
|
|
if state:
|
|
lastStart = WorldManager.getTime()
|
|
return state
|
|
func timeSinceLastStart():
|
|
return WorldManager.getTime() - lastStart
|