兼容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缓存导致检测不到更新的问题
## 1.0.33
- UI模块添加fgui控制器和动画装饰器详情见 [UI模块](./docs/UI.md)
## 1.0.34
- 兼容性修改兼容creator3.7及之后的版本

View File

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

View File

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

View File

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

View File

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

View File

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