mirror of
https://github.com/Gongxh0901/kunpolibrary
synced 2025-10-09 16:45:45 +00:00
兼容creator3.7+版本支持
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
@@ -38,17 +38,22 @@ export class CocosAdapter extends Adapter {
|
||||
* @internal
|
||||
*/
|
||||
protected registerResizeCallback(callback: (...args: any) => void): void {
|
||||
ccScreen.on("window-resize", (...args: any) => {
|
||||
debug("window-resize");
|
||||
callback(...args);
|
||||
}, this);
|
||||
ccScreen.on("orientation-change", (...args: any) => {
|
||||
debug("orientation-change");
|
||||
callback(...args);
|
||||
}, this);
|
||||
ccScreen.on("fullscreen-change", (...args: any) => {
|
||||
debug("fullscreen-change");
|
||||
callback(...args);
|
||||
}, this);
|
||||
if (ccScreen && ccScreen.on) {
|
||||
ccScreen.on("window-resize", (...args: any) => {
|
||||
debug("window-resize");
|
||||
callback(...args);
|
||||
}, this);
|
||||
ccScreen.on("orientation-change", (...args: any) => {
|
||||
debug("orientation-change");
|
||||
callback(...args);
|
||||
}, this);
|
||||
ccScreen.on("fullscreen-change", (...args: any) => {
|
||||
debug("fullscreen-change");
|
||||
callback(...args);
|
||||
}, this);
|
||||
} else {
|
||||
// 3.8.0之前的版本
|
||||
view.setResizeCallback(callback);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -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";
|
||||
|
Reference in New Issue
Block a user