refactor: 移除调试日志并统一使用日志工具
- 删除多个文件中的 console.log/console.warn/console.error 调试输出 - 将日志输出统一替换为 mLogger 工具,支持调试模式控制 - 清理注释掉的调试代码和空方法体
This commit is contained in:
@@ -7,8 +7,6 @@ import { HeroViewComp } from "./HeroViewComp";
|
||||
import { BoxSet, FacSet, IndexSet } from "../common/config/GameSet";
|
||||
import { HeroInfo, HeroPos, HType } from "../common/config/heroSet";
|
||||
import { GameEvent } from "../common/config/GameEvent";
|
||||
import { SkillSet } from "../common/config/SkillSet";
|
||||
import { time } from "console";
|
||||
import { getNeAttrs, getAttrs ,Attrs} from "../common/config/HeroAttrs";
|
||||
import { HeroSkillsComp } from "./HeroSkills";
|
||||
import { HeroMoveComp } from "./HeroMove";
|
||||
@@ -24,6 +22,7 @@ export class Hero extends ecs.Entity {
|
||||
View!: HeroViewComp;
|
||||
HeroMove!: HeroMoveComp;
|
||||
TalComp!: TalComp;
|
||||
debugMode: boolean = false; // 是否启用调试模式
|
||||
protected init() {
|
||||
this.addComponents<ecs.Comp>(
|
||||
HeroMoveComp,
|
||||
@@ -50,7 +49,6 @@ export class Hero extends ecs.Entity {
|
||||
|
||||
/** 加载角色 */
|
||||
load(pos: Vec3 = Vec3.ZERO,scale:number = 1,uuid:number=1001,fight_pos:number=1,is_master:boolean=false,is_friend:boolean=false) {
|
||||
// console.log("英雄加载:",uuid,pos,scale,info)
|
||||
scale = 1
|
||||
// 查找空闲英雄槽位
|
||||
let size=1
|
||||
@@ -66,9 +64,8 @@ export class Hero extends ecs.Entity {
|
||||
|
||||
// 🔥 设置初始 SiblingIndex - 英雄基础层级 + 位置偏移
|
||||
|
||||
console.log("hero",node.getSiblingIndex());
|
||||
mLogger.log(this.debugMode,"hero",node.getSiblingIndex());
|
||||
|
||||
// console.log("hero load",pos)
|
||||
var hv = node.getComponent(HeroViewComp)!;
|
||||
const model = this.get(HeroAttrsComp);
|
||||
const skillsComp = this.get(HeroSkillsComp);
|
||||
@@ -89,7 +86,7 @@ export class Hero extends ecs.Entity {
|
||||
model.rangeType = hero.rangeType;
|
||||
// 只有主角才挂载天赋组件
|
||||
if (is_master) {
|
||||
console.log(`[Hero] 主角创建, uuid=${uuid}`);
|
||||
mLogger.log(this.debugMode,`[Hero] 主角创建, uuid=${uuid}`);
|
||||
this.add(TalComp);
|
||||
this.add(HeroMasterComp)
|
||||
const talComp = this.get(TalComp);
|
||||
|
||||
Reference in New Issue
Block a user