import Sprite3D = Laya.Sprite3D;
import PassivityBehaviour from "../Behaviour/PassivityBehaviour";
export class ObsController {
    private static instance: ObsController;
    public static get Instance(): ObsController {
        return ObsController.instance || (ObsController.instance = new ObsController());
    }

    public Init(obs: any[]) {
        if (obs && obs.length > 0) {
            for (let index = 0; index < obs.length; index++) {
                for (let j = 0; j < obs[index]._children.length; j++) {
                    const element = obs[index].getChildAt(j) as Sprite3D;
                    var _o = element.getChildAt(0);
                    var _pb = _o.addComponent(PassivityBehaviour)as PassivityBehaviour;
                    _pb.init();
                }
            }
        }
    }
}