22 lines
646 B
TypeScript
22 lines
646 B
TypeScript
import { _decorator, Component, Node, Prefab } from 'cc';
|
|
const { ccclass, property } = _decorator;
|
|
|
|
@ccclass('SpawnObjectManager')
|
|
export class SpawnObjectManager extends Component {
|
|
//#region singleton
|
|
private static _instance: SpawnObjectManager = null;
|
|
public static get instance(): SpawnObjectManager {
|
|
return SpawnObjectManager._instance;
|
|
}
|
|
//#endregion
|
|
|
|
@property({ type: [Prefab], visible: true })
|
|
private _objects: Prefab[] = [];
|
|
@property({ type: [Node], visible: true })
|
|
private _spawnPoints: Node[] = [];
|
|
|
|
protected onLoad(): void {
|
|
SpawnObjectManager._instance = this;
|
|
}
|
|
}
|