From e0a2054397a2fb5a2a60e8a68db12aca1312b3d2 Mon Sep 17 00:00:00 2001 From: dgflash Date: Tue, 8 Apr 2025 20:20:53 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E5=88=A0=E9=99=A4console.assert=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E7=9A=84=E5=BC=95=E7=94=A8=EF=BC=8C=E8=A7=84=E9=81=BF?= =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=B0=8F=E6=B8=B8=E6=88=8F=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E4=B8=8D=E5=85=BC=E5=AE=B9=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/libs/animator-move/MoveTo.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/assets/libs/animator-move/MoveTo.ts b/assets/libs/animator-move/MoveTo.ts index 6b3792d..5addcf3 100644 --- a/assets/libs/animator-move/MoveTo.ts +++ b/assets/libs/animator-move/MoveTo.ts @@ -52,7 +52,10 @@ export class MoveTo extends Component { update(dt: number) { let end: Vec3; - console.assert(this.speed > 0, "移动速度必须要大于零"); + if (this.speed <= 0) { + console.error("移动速度必须要大于零"); + return; + } if (this.target instanceof Node) { end = this.ns == Node.NodeSpace.WORLD ? this.target.worldPosition : this.target.position; From 33d5c41dfb44b32788fc06a861aff8ba5eb64f75 Mon Sep 17 00:00:00 2001 From: dgflash Date: Tue, 15 Apr 2025 21:03:36 +0800 Subject: [PATCH 2/6] =?UTF-8?q?GameComponent.createPrefabNodeAsync?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E6=B7=BB=E5=8A=A0=E8=87=AA=E5=8A=A8=E6=96=BD?= =?UTF-8?q?=E6=94=BE=E8=B5=84=E6=BA=90=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/module/common/GameComponent.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/assets/module/common/GameComponent.ts b/assets/module/common/GameComponent.ts index 02ff5a0..fbc083d 100644 --- a/assets/module/common/GameComponent.ts +++ b/assets/module/common/GameComponent.ts @@ -4,7 +4,7 @@ * @LastEditors: dgflash * @LastEditTime: 2022-12-13 11:36:00 */ -import { Asset, Button, Component, EventHandler, EventKeyboard, EventTouch, Input, Node, Sprite, SpriteFrame, __private, _decorator, input, isValid } from "cc"; +import { Asset, Button, Component, EventHandler, EventKeyboard, EventTouch, Input, Node, Prefab, Sprite, SpriteFrame, __private, _decorator, input, isValid } from "cc"; import { oops } from "../../core/Oops"; import { EventDispatcher } from "../../core/common/event/EventDispatcher"; import { EventMessage, ListenerFunc } from "../../core/common/event/EventMessage"; @@ -76,7 +76,7 @@ export class GameComponent extends Component { //#region 预制节点管理 /** 摊平的节点集合(所有节点不能重名) */ - protected nodes: Map = null!; + nodes: Map = null!; /** 通过节点名获取预制上的节点,整个预制不能有重名节点 */ getNode(name: string): Node | undefined { @@ -106,7 +106,11 @@ export class GameComponent extends Component { * @param bundleName 资源包名 */ createPrefabNodeAsync(path: string, bundleName: string = oops.res.defaultBundleName): Promise { - return ViewUtil.createPrefabNodeAsync(path, bundleName); + return new Promise(async (resolve, reject) => { + await this.loadAsync(bundleName, path, Prefab); + let node = ViewUtil.createPrefabNode(path, bundleName); + resolve(node); + }); } //#endregion From 5708c10f48916329b3e6b1eda202be95bddd9919 Mon Sep 17 00:00:00 2001 From: dgflash Date: Tue, 22 Apr 2025 16:58:49 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E4=BF=AE=E5=A4=8DGameComponent.playEffect?= =?UTF-8?q?=E6=92=AD=E6=94=BE=E9=9F=B3=E6=95=88=E6=9C=AA=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E6=97=B6=E7=BB=84=E4=BB=B6=E9=87=8A=E6=94=BE=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E7=9A=84=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/module/common/GameComponent.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/module/common/GameComponent.ts b/assets/module/common/GameComponent.ts index fbc083d..2bb99be 100644 --- a/assets/module/common/GameComponent.ts +++ b/assets/module/common/GameComponent.ts @@ -347,6 +347,8 @@ export class GameComponent extends Component { async playEffect(url: string, bundleName?: string) { if (bundleName == null) bundleName = oops.res.defaultBundleName; await oops.audio.playEffect(url, bundleName, () => { + if (!this.isValid) return; + const rps = this.resPaths.get(ResType.Audio); if (rps) { const key = this.getResKey(bundleName, url); @@ -489,7 +491,6 @@ export class GameComponent extends Component { /** 游戏旋转屏幕事件回调 */ protected onGameOrientation(): void { } //#endregion - protected onDestroy() { // 释放消息对象 if (this._event) { From c5a13ab7bb643e0fef9d901b1c07d77ae4bb7ab8 Mon Sep 17 00:00:00 2001 From: dgflash Date: Tue, 22 Apr 2025 17:00:48 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9GUI=E7=AA=97=E5=8F=A3?= =?UTF-8?q?=E7=9A=84onRemoved=E4=BA=8B=E4=BB=B6=E5=9C=A8=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E7=A7=BB=E9=99=A4=E7=88=B6=E8=8A=82=E7=82=B9=E6=97=B6=E8=A7=A6?= =?UTF-8?q?=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/core/gui/layer/DelegateComponent.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/assets/core/gui/layer/DelegateComponent.ts b/assets/core/gui/layer/DelegateComponent.ts index 0d54119..43b6c5e 100644 --- a/assets/core/gui/layer/DelegateComponent.ts +++ b/assets/core/gui/layer/DelegateComponent.ts @@ -100,11 +100,12 @@ export class DelegateComponent extends Component { else { this.node.removeFromParent(); } + + // 触发窗口组件上窗口移除之后的事件 + this.applyComponentsFunction(this.node, EventOnRemoved, this.vp.params); } onDestroy() { - // 触发窗口组件上窗口移除之后的事件 - this.applyComponentsFunction(this.node, EventOnRemoved, this.vp.params); this.vp = null!; } From 26a52124188137e63bb57ade46d2b8a1ee63097a Mon Sep 17 00:00:00 2001 From: dgflash Date: Wed, 23 Apr 2025 11:36:37 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E4=BF=AE=E5=A4=8DExcel=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E7=9A=84=E5=A4=9A=E8=AF=AD=E8=A8=80=E9=85=8D=E7=BD=AE=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E4=B8=8D=E5=88=B0=E5=AF=B9=E5=BA=94=E8=AF=AD=E8=A8=80?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/libs/gui/language/LanguageData.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/assets/libs/gui/language/LanguageData.ts b/assets/libs/gui/language/LanguageData.ts index a07c751..e28daca 100644 --- a/assets/libs/gui/language/LanguageData.ts +++ b/assets/libs/gui/language/LanguageData.ts @@ -42,8 +42,14 @@ export class LanguageData { * 3、config/game/Language配置表使用oops-plugin-excel-to-json插件生成,点击项目根目录下载update-oops-plugin-framework.bat或update-oops-plugin-framework.sh脚本下载插件 */ public static getLangByID(labId: string): string { + let content: string = null!; for (const [key, value] of this.language) { - const content = value[labId]; + if (key == LanguageDataType.Excel) { + content = value[labId][this.current]; + } + else { + content = value[labId]; + } if (content) return content; } return labId; From cf0c937f1d514776a9bc99563fca0ef2de8d8089 Mon Sep 17 00:00:00 2001 From: dgflash Date: Wed, 23 Apr 2025 11:51:20 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/core/Oops.ts | 2 +- assets/libs/gui/language/LanguageData.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/assets/core/Oops.ts b/assets/core/Oops.ts index f2cf8aa..8625601 100644 --- a/assets/core/Oops.ts +++ b/assets/core/Oops.ts @@ -24,7 +24,7 @@ import { GameManager } from "./game/GameManager"; import { LayerManager } from "./gui/layer/LayerManager"; /** 框架版本号 */ -export var version: string = "2.0.0.20250404"; +export var version: string = "2.0.0.20250423"; /** 框架核心模块访问入口 */ export class oops { diff --git a/assets/libs/gui/language/LanguageData.ts b/assets/libs/gui/language/LanguageData.ts index e28daca..0e99f51 100644 --- a/assets/libs/gui/language/LanguageData.ts +++ b/assets/libs/gui/language/LanguageData.ts @@ -41,11 +41,12 @@ export class LanguageData { * * 3、config/game/Language配置表使用oops-plugin-excel-to-json插件生成,点击项目根目录下载update-oops-plugin-framework.bat或update-oops-plugin-framework.sh脚本下载插件 */ - public static getLangByID(labId: string): string { + static getLangByID(labId: string): string { let content: string = null!; for (const [key, value] of this.language) { if (key == LanguageDataType.Excel) { - content = value[labId][this.current]; + let lang = value[labId]; + if (lang) content = lang[this.current]; } else { content = value[labId];