mirror of
https://github.com/photonstorm/phaser
synced 2024-11-23 13:13:43 +00:00
Removed loadArray and fixed addPack return
This commit is contained in:
parent
ebf77e2bbc
commit
acf6b94b2f
1 changed files with 6 additions and 32 deletions
|
@ -501,6 +501,8 @@ var LoaderPlugin = new Class({
|
|||
* @since 3.7.0
|
||||
*
|
||||
* @param {any} data - The Pack File data, or an array of Pack File data, to be added to the load queue.
|
||||
*
|
||||
* @return {boolean} `true` if any files were added to the queue, otherwise `false`.
|
||||
*/
|
||||
addPack: function (pack, packKey)
|
||||
{
|
||||
|
@ -510,6 +512,8 @@ var LoaderPlugin = new Class({
|
|||
pack = { packKey: pack[packKey] };
|
||||
}
|
||||
|
||||
var total = 0;
|
||||
|
||||
// Store the loader settings in case this pack replaces them
|
||||
var currentBaseURL = this.baseURL;
|
||||
var currentPath = this.path;
|
||||
|
@ -541,6 +545,7 @@ var LoaderPlugin = new Class({
|
|||
if (this[type])
|
||||
{
|
||||
this[type](file);
|
||||
total++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -551,7 +556,7 @@ var LoaderPlugin = new Class({
|
|||
this.setPath(currentPath);
|
||||
this.setPrefix(currentPrefix);
|
||||
|
||||
return this;
|
||||
return (total > 0);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -864,37 +869,6 @@ var LoaderPlugin = new Class({
|
|||
this.state = CONST.LOADER_IDLE;
|
||||
},
|
||||
|
||||
/**
|
||||
* !!! TO BE REPLACED BY THE PACK LOADER METHOD !!!
|
||||
* !!! TO BE REPLACED BY THE PACK LOADER METHOD !!!
|
||||
* !!! TO BE REPLACED BY THE PACK LOADER METHOD !!!
|
||||
*
|
||||
* Called by the Scene Manager if you specify a files payload for a pre-Scene Boot.
|
||||
* Takes an array of file objects.
|
||||
*
|
||||
* @method Phaser.Loader.LoaderPlugin#loadArray
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {LoaderFileObject[]} files - An array of files to load.
|
||||
*
|
||||
* @return {boolean} `true` if any files were successfully added to the list, otherwise `false`.
|
||||
*/
|
||||
loadArray: function (files)
|
||||
{
|
||||
if (Array.isArray(files))
|
||||
{
|
||||
for (var i = 0; i < files.length; i++)
|
||||
{
|
||||
var file = files[i];
|
||||
|
||||
// Calls file-type methods like `atlas` or `image`
|
||||
this[file.type](file);
|
||||
}
|
||||
}
|
||||
|
||||
return (this.list.size > 0);
|
||||
},
|
||||
|
||||
/**
|
||||
* The Scene that owns this plugin is shutting down.
|
||||
* We need to kill and reset all internal properties as well as stop listening to Scene events.
|
||||
|
|
Loading…
Reference in a new issue