mirror of
https://gitee.com/dgflash/oops-plugin-framework.git
synced 2026-05-07 01:01:09 +08:00
CCEntity.addPrefab方法修改为返回节点
This commit is contained in:
@@ -74,11 +74,12 @@ export abstract class CCEntity extends ecs.Entity {
|
||||
* @param path 显示资源地址
|
||||
* @param bundleName 资源包名称
|
||||
*/
|
||||
addPrefab<T extends ECSView>(ctor: ECSCtor<T>, parent: Node, path: string, bundleName: string = resLoader.defaultBundleName) {
|
||||
addPrefab<T extends ECSView>(ctor: ECSCtor<T>, parent: Node, path: string, bundleName: string = resLoader.defaultBundleName): Node {
|
||||
const node = ViewUtil.createPrefabNode(path, bundleName);
|
||||
const comp = node.getComponent(ctor)!;
|
||||
this.add(comp);
|
||||
node.parent = parent;
|
||||
return node;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user