This commit is contained in:
dgflash
2025-10-09 15:58:03 +08:00
parent 98adbf97fa
commit de8189bb58

View File

@@ -5,9 +5,9 @@
* @LastEditTime: 2022-09-02 12:09:55
*/
import { Node, director } from 'cc';
import { GameComponent } from '../../module/common/GameComponent';
import { resLoader } from '../common/loader/ResLoader';
import { ViewUtil } from '../utils/ViewUtil';
import { resLoader } from '../common/loader/ResLoader';
import { GameComponent } from '../../module/common/GameComponent';
/** 游戏元素打开参数 */
export interface ElementParams {
@@ -45,7 +45,8 @@ export class GameManager {
let node: Node = null!;
// 自动内存管理
if (parent instanceof GameComponent) {
node = await parent.createPrefabNode(prefabPath, bundleName);
await parent.load(bundleName, prefabPath);
node = parent.createPrefabNode(prefabPath, bundleName);
node.parent = parent.node;
}
// 手动内存管理