refactor: 统一替换内置console日志为可配置化日志系统
1. 将各业务模块中的硬编码console日志替换为自定义Logger模块,新增DEBUG开关控制日志输出 2. 为MissSkillsComp新增道具卡牌使用处理逻辑,支持药水类技能直接给全队施加buff 3. 修复了道具卡牌事件监听绑定错误的问题 4. 新增了hero预制体的meta配置文件 5. 调整了装备预制体的UI布局参数
This commit is contained in:
@@ -11,6 +11,10 @@
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { BuffCategory, BuffList } from "../common/config/BuffSet";
|
||||
import { BuffComp, ActiveBuff } from "./BuffComp";
|
||||
import { mLogger } from "../common/Logger";
|
||||
|
||||
/** Buff 模块调试日志开关 */
|
||||
const DEBUG = false;
|
||||
|
||||
/** applyBuff 的覆盖参数(预留按需覆写持续时间 / 修饰数值) */
|
||||
export interface BuffApplyOverrides {
|
||||
@@ -37,10 +41,10 @@ class BuffManagerImpl {
|
||||
applyBuff(target: ecs.Entity, buffId: number, sourceUuid: number = 0, sourceAp: number = 0, overrides?: BuffApplyOverrides): void {
|
||||
const cfg = BuffList[buffId];
|
||||
if (!cfg) {
|
||||
console.log(`[BuffManager] applyBuff: buffId=${buffId} 配置不存在,跳过`);
|
||||
mLogger.warn(true, "BuffManager", `applyBuff: buffId=${buffId} 配置不存在,跳过`);
|
||||
return;
|
||||
}
|
||||
console.log(`[BuffManager] applyBuff: buff=${cfg.name}(${buffId}) target_eid=${target.eid} duration=${overrides?.duration ?? cfg.duration} value_override=${overrides?.value} source_ap=${sourceAp}`);
|
||||
mLogger.log(DEBUG, "BuffManager", `applyBuff: buff=${cfg.name}(${buffId}) target_eid=${target.eid} duration=${overrides?.duration ?? cfg.duration} value_override=${overrides?.value} source_ap=${sourceAp}`);
|
||||
|
||||
const buffComp = this.ensureBuffComp(target);
|
||||
const duration = overrides?.duration ?? cfg.duration;
|
||||
|
||||
Reference in New Issue
Block a user