兼容creator3.7+版本支持

This commit is contained in:
gongxh 2025-05-09 21:48:17 +08:00
parent 351c806d1b
commit 17d3cc968e
6 changed files with 31 additions and 17 deletions

View File

@ -16,3 +16,5 @@
- 修复热更新manifest文件cdn缓存导致检测不到更新的问题 - 修复热更新manifest文件cdn缓存导致检测不到更新的问题
## 1.0.33 ## 1.0.33
- UI模块添加fgui控制器和动画装饰器详情见 [UI模块](./docs/UI.md) - UI模块添加fgui控制器和动画装饰器详情见 [UI模块](./docs/UI.md)
## 1.0.34
- 兼容性修改兼容creator3.7及之后的版本

View File

@ -1,7 +1,13 @@
# KunpoLib # KunpoLib
基于 Cocos Creator 3.0+ 的一套游戏框架,提供了一系列实用模块,帮助开发者快速构建高质量的游戏项目。 基于 Cocos Creator 的一套游戏框架,提供了一系列实用模块,帮助开发者快速构建高质量的游戏项目。
项目持续优化中,敬请期待~~~ 项目持续优化中,敬请期待~~~
#### 版本支持
- creator 3.7之前的版本理论上也支持,未测试
- creator 3.7+ 支持
- creator 3.8+ 支持
> 此项目是框架源码不是creator项目 > 此项目是框架源码不是creator项目
> >
> demo见最下方仓库地址 > demo见最下方仓库地址
@ -66,7 +72,7 @@ gongxh
* 邮箱: gong.xinhai@163.com * 邮箱: gong.xinhai@163.com
## 仓库 ## 仓库
[kunpocc gitree地址](https://gitee.com/gongxinhai/kunpolibrary) [kunpocc gitee地址](https://gitee.com/gongxinhai/kunpolibrary)
[kunpocc github地址](https://github.com/Gongxh0901/kunpolibrary) [kunpocc github地址](https://github.com/Gongxh0901/kunpolibrary)

View File

@ -1,6 +1,6 @@
{ {
"name": "kunpocc", "name": "kunpocc",
"version": "1.0.33", "version": "1.0.34",
"description": "基于creator3.0+的kunpocc库", "description": "基于creator3.0+的kunpocc库",
"main": "./dist/kunpocc.cjs", "main": "./dist/kunpocc.cjs",
"module": "./dist/kunpocc.mjs", "module": "./dist/kunpocc.mjs",

View File

@ -32,7 +32,7 @@ export class AssetPool {
this.add(item, bundle, batchName); this.add(item, bundle, batchName);
} }
} else { } else {
let uuid = asset.uuid; let uuid = asset.uuid || asset._uuid;
if (this._uuidToName.has(uuid)) { if (this._uuidToName.has(uuid)) {
return; return;
} }

View File

@ -38,17 +38,22 @@ export class CocosAdapter extends Adapter {
* @internal * @internal
*/ */
protected registerResizeCallback(callback: (...args: any) => void): void { protected registerResizeCallback(callback: (...args: any) => void): void {
ccScreen.on("window-resize", (...args: any) => { if (ccScreen && ccScreen.on) {
debug("window-resize"); ccScreen.on("window-resize", (...args: any) => {
callback(...args); debug("window-resize");
}, this); callback(...args);
ccScreen.on("orientation-change", (...args: any) => { }, this);
debug("orientation-change"); ccScreen.on("orientation-change", (...args: any) => {
callback(...args); debug("orientation-change");
}, this); callback(...args);
ccScreen.on("fullscreen-change", (...args: any) => { }, this);
debug("fullscreen-change"); ccScreen.on("fullscreen-change", (...args: any) => {
callback(...args); debug("fullscreen-change");
}, this); callback(...args);
}, this);
} else {
// 3.8.0之前的版本
view.setResizeCallback(callback);
}
} }
} }

View File

@ -3,10 +3,11 @@
* @Date: 2024-12-07 * @Date: 2024-12-07
* @Description: cocos UI模块 * @Description: cocos UI模块
*/ */
import { _decorator, debug } from "cc"; import { _decorator } from "cc";
import { GRoot } from "fairygui-cc"; import { GRoot } from "fairygui-cc";
import { ModuleBase } from "../module/ModuleBase"; import { ModuleBase } from "../module/ModuleBase";
import { debug } from "../tool/log";
import { WindowManager } from "../ui/WindowManager"; import { WindowManager } from "../ui/WindowManager";
import { WindowResPool } from "../ui/WindowResPool"; import { WindowResPool } from "../ui/WindowResPool";
import { CocosWindowContainer } from "./CocosWindowContainer"; import { CocosWindowContainer } from "./CocosWindowContainer";