How to judge that all models have been loaded in threejs?

recently, threeJs loading model is used. A single model has onLoad callback, but generally not only one model is loaded. How can you tell that all models have been loaded?

Apr.01,2021

if you don't post the code, just use the example of the official website

// instantiate a loader
var loader = new THREE.OBJLoader();

// load a resource
loader.load(
    // resource URL
    'models/monster.obj',
    // called when resource is loaded
    function ( object ) {

        scene.add( object );
        //add
        //boolmapint
        cnt += 1; //+1
        if(cnt > 10) {//
            //todo
        }
    },
    // called when loading is in progresses
    function ( xhr ) {

        console.log( ( xhr.loaded / xhr.total * 100 ) + '% loaded' );

    },
    // called when loading has errors
    function ( error ) {

        console.log( 'An error happened' );

    }
);
Menu