日志控制

This commit is contained in:
chen wei bo
2025-09-21 20:18:30 +08:00
parent 23c038fd14
commit 8f90c1d7cf
23 changed files with 207 additions and 178 deletions
+6 -4
View File
@@ -1,6 +1,8 @@
import { _decorator, Component, Node, tween, UIOpacity, Vec3, VideoPlayer } from 'cc';
import Utils from '../Common/Utils';
import { VideoRoleType } from '../Common/GlobalValue';
import { logger } from "db://assets/Scripts/Main/Common/Logger";
const { ccclass, property } = _decorator;
/**背景视频 */
@@ -49,14 +51,14 @@ export class BgVideo extends Component {
update(deltaTime: number) {
// if (this._isPlaying && this.vtype == VideoRoleType.Idle) {
// console.log("BgVideo 主视频时长:", this.vp.currentTime, this.vp.duration);
// logger.log("BgVideo 主视频时长:", this.vp.currentTime, this.vp.duration);
// }
}
/**播放视频 */
playVideo(remoteUrl:string, loop:boolean = false, autoIn:boolean = true) {
console.log("BgVideo 播放视频:", this.node.position)
logger.log("BgVideo 播放视频:", this.node.position)
this.vp.remoteURL = remoteUrl
this.vp.loop = loop
this.vp.stop()
@@ -69,7 +71,7 @@ export class BgVideo extends Component {
/**暂停视频 */
pauseVideo() {
console.log("BgVideo 暂停视频:", this._vtype)
logger.log("BgVideo 暂停视频:", this._vtype)
this.vp.pause()
}
/**继续播放 */
@@ -99,7 +101,7 @@ export class BgVideo extends Component {
onVideoEvent(event1:any, event2:any) {
// console.log("bgvideo BgVideo组件 event", event2, this._vtype)
// logger.log("bgvideo BgVideo组件 event", event2, this._vtype)
if (event2 == "ready-to-play") {
// if (!this._emoShow) {
// this._emoShow = true;
+8 -6
View File
@@ -1,5 +1,7 @@
import { _decorator, Component, EditBox, Label, macro, Node, view } from 'cc';
import GameRootUI from './GameRootUI';
import { logger } from "db://assets/Scripts/Main/Common/Logger";
const { ccclass, property, requireComponent } = _decorator;
//输入框事件监听
@@ -18,7 +20,7 @@ export class EditBoxEvent extends Component {
this.node.on(EditBox.EventType.EDITING_DID_BEGAN, this.onEditDidBegan, this);
this.node.on(EditBox.EventType.EDITING_DID_ENDED, this.onEditDidEnded, this);
this.node.on(EditBox.EventType.EDITING_RETURN, this.onEditingReturn, this);
console.log("EditBoxEvent: start.")
logger.log("EditBoxEvent: start.")
}
update(deltaTime: number) {
@@ -27,20 +29,20 @@ export class EditBoxEvent extends Component {
onEditDidBegan(editbox, customEventData) {
console.log("EditBoxEvent: 开始编辑...")
logger.log("EditBoxEvent: 开始编辑...")
// view.setOrientation(macro.ORIENTATION_LANDSCAPE); //设置横屏
// console.log("窗口大小 开始:", view.getVisibleSize(), GameRootUI.MainCamera)
// logger.log("窗口大小 开始:", view.getVisibleSize(), GameRootUI.MainCamera)
}
onEditDidEnded(editbox, customEventData) {
console.log("EditBoxEvent: 结束编辑.")
logger.log("EditBoxEvent: 结束编辑.")
// view.setOrientation(macro.ORIENTATION_LANDSCAPE); //设置横屏
// console.log("窗口大小 结束:", view.getVisibleSize(), GameRootUI.MainCamera)
// logger.log("窗口大小 结束:", view.getVisibleSize(), GameRootUI.MainCamera)
}
onEditingReturn(editbox, customEventData) {
console.log("EditBoxEvent: 按下返回.")
logger.log("EditBoxEvent: 按下返回.")
}
}