Skip to main content

update 更新公共冷却时间

update

类型: MethodDeclaration

所属类: CooldownManager

定义位置: actor.ts

描述

更新公共冷却时间

参数 deltaTime: 增量时间(毫秒)

参数

参数名类型描述默认值
deltaTimenumber--

返回值

类型: void

源代码

位置: 第 5269 行

public update(deltaTime: number): void {
const { cooldownList } = this;
let i = cooldownList.length;
// 逆序遍历冷却列表
while (--i >= 0) {
// 如果冷却结束,删除键
if ((cooldownList[i].cooldown -= deltaTime) <= 0) {
this.delete(cooldownList[i].key);
}
}
}

文档生成时间:2026/2/1 16:51:38