perf: 移除调试日志并统一调试模式控制

- 将 HeroAttrsComp 中的 console.log 改为注释以提升性能
- 将 HeroViewComp 的 debugMode 默认值设为 false 并移除冗余日志
- 在 SkillView 中统一添加 debugMode 控制,替换直接 console 调用
- 在 MissionCardComp 中添加调试日志以跟踪卡牌应用效果
This commit is contained in:
panw
2026-02-03 10:36:41 +08:00
parent 031b91311a
commit c07678f31f
4 changed files with 51 additions and 19 deletions

View File

@@ -26,7 +26,7 @@ export interface BuffInfo {
@ccclass('HeroViewComp') // 定义Cocos Creator 组件
@ecs.register('HeroView', false) // 定义ECS 组件
export class HeroViewComp extends CCComp {
private debugMode: boolean = true; // 是否启用调试模式
private debugMode: boolean = false; // 是否启用调试模式
// 添加条件日志方法
private debugLog(...args: any[]): void {
@@ -198,7 +198,7 @@ export class HeroViewComp extends CCComp {
// 不再基于血量是否满来决定显示状态,只更新进度条
let hp=this.model.hp;
let hp_max=this.model.Attrs[Attrs.HP_MAX];
this.debugLog("hp_show",hp,hp_max)
// this.debugLog("hp_show",hp,hp_max)
let targetProgress = hp / hp_max;
let hpNode = this.top_node.getChildByName("hp");
@@ -500,18 +500,10 @@ export class HeroViewComp extends CCComp {
}
// 伤害计算和战斗逻辑已迁移到 HeroBattleSystem
/** 调试日志(已禁用) */
to_console(value:any, value2:any=null, value3:any=null){
// 调试用,生产环境已禁用
}
playSkillEffect(skill_id:number) {
let skill = SkillSet[skill_id]
console.log('[heroview] skill_id'+skill_id,skill)
this.debugLog('[heroview] skill_id'+skill_id,skill)
if (!skill) return;
switch(skill.act){
case "max":