Merge pull request #6002 from rexrainbow/pack-loader-dotnotation-datakey

Can use dot notation as datakey
This commit is contained in:
Richard Davey 2022-04-14 15:49:36 +01:00 committed by GitHub
commit d53d8f3ea5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -11,6 +11,7 @@ var EventEmitter = require('eventemitter3');
var Events = require('./events');
var FileTypesManager = require('./FileTypesManager');
var GetFastValue = require('../utils/object/GetFastValue');
var GetValue = require('../utils/object/GetValue');
var PluginCache = require('../plugins/PluginCache');
var SceneEvents = require('../scene/events');
var XHRSettings = require('./XHRSettings');
@ -603,9 +604,12 @@ var LoaderPlugin = new Class({
addPack: function (pack, packKey)
{
// if no packKey provided we'll add everything to the queue
if (packKey && pack.hasOwnProperty(packKey))
if (packKey)
{
pack = { packKey: pack[packKey] };
var subPack = GetValue(pack, packKey);
if (subPack) {
pack = { packKey: subPack };
}
}
var total = 0;