| 123456789101112131415161718192021 |
- const {ccclass, property} = cc._decorator;
- @ccclass
- export class MapSpawner extends cc.Component {
- onLoad():void{
- let prefabInfos:PrefabInfo[] = [];
- for (let i = 0; i < this.node.children.length; i++) {
- let child = this.node.children[i];
- prefabInfos[i] = {
- name: child.name,
- position: child.getPosition(),
- angle: child.angle,
- size: child.getContentSize()
- };
- }
- console.log(JSON.stringify(prefabInfos))
- }
- }
|