@@ -421,20 +421,20 @@ cc.LoaderLayer.preload = function (groupname, callback, target) {
421
421
}
422
422
}
423
423
var callPreload = function ( ) {
424
- if ( cc . director . getRunningScene ( ) ) {
425
- loaderLayer . updateGroup ( groupname , preloadCb , target ) ;
426
- loaderLayer . _addToScene ( ) ;
427
- loaderLayer . _preloadSource ( ) ;
428
- } else {
429
- cc . log ( "Current scene is null we can't start preload" ) ;
430
- }
424
+ loaderLayer . updateGroup ( groupname , preloadCb , target ) ;
425
+ loaderLayer . _addToScene ( ) ;
426
+ loaderLayer . _preloadSource ( ) ;
431
427
} ;
432
428
433
429
if ( res_engine_loaded ) {
434
430
callPreload ( ) ;
435
431
return ;
436
432
}
437
433
434
+ if ( ! cc . director . getRunningScene ( ) ) {
435
+ cc . director . runScene ( new cc . Scene ( ) ) ;
436
+ }
437
+
438
438
// Res engine not loaded, load them
439
439
cc . loader . load ( [
440
440
GROUP_JSON_PATH ,
@@ -972,3 +972,18 @@ cc.network.preloadstatus = {
972
972
cc . runtime . network = cc . network ;
973
973
974
974
} ) ( ) ;
975
+
976
+ cc . LoaderScene . _preload = cc . LoaderScene . preload ;
977
+ cc . LoaderScene . preload = function ( arr , cb , target ) {
978
+ // No extension
979
+ var isGroups = ( arr [ 0 ] && arr [ 0 ] . indexOf ( '.' ) === - 1 ) ;
980
+ if ( isGroups ) {
981
+ if ( arr . indexOf ( 'boot' ) === - 1 ) {
982
+ arr . splice ( 0 , 0 , 'boot' ) ;
983
+ }
984
+ cc . LoaderLayer . preload ( arr , cb , target ) ;
985
+ }
986
+ else {
987
+ cc . LoaderScene . _preload ( arr , cb , target ) ;
988
+ }
989
+ }
0 commit comments