decreaseCooldown 减少冷却时间
decreaseCooldown
类型: MethodDeclaration
所属类: CooldownManager
定义位置: actor.ts
描述
减少冷却时间
参数 key
: 冷却键
参数 cooldown
: 冷却时间
参数
参数名 | 类型 | 描述 | 默认值 |
---|---|---|---|
key | string | - | - |
cooldown | number | - | - |
返回值
类型: void
源代码
位置: 第 4981 行
public decreaseCooldown(key: string, cooldown: number): void {
const item = this.keyMap[key]
if (item && cooldown > 0) {
item.cooldown -= cooldown
// 如果冷却结束,删除键
if (item.cooldown <= 0) {
this.delete(key)
}
}
}
文档生成时间:2025/7/7 12:07:06