2018-02-12 16:01:20 +00:00
|
|
|
/**
|
|
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
|
|
* @copyright 2018 Photon Storm Ltd.
|
|
|
|
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
|
|
|
|
*/
|
|
|
|
|
2017-09-01 16:51:51 +00:00
|
|
|
var GetValue = require('../../utils/object/GetValue');
|
|
|
|
|
2018-02-10 17:11:36 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @function Phaser.Tweens.Builders.GetTargets
|
|
|
|
* @since 3.0.0
|
|
|
|
*
|
|
|
|
* @param {object} config - [description]
|
|
|
|
*
|
|
|
|
* @return {array} [description]
|
|
|
|
*/
|
2017-09-01 16:51:51 +00:00
|
|
|
var GetTargets = function (config)
|
|
|
|
{
|
|
|
|
var targets = GetValue(config, 'targets', null);
|
|
|
|
|
|
|
|
if (targets === null)
|
|
|
|
{
|
|
|
|
return targets;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (typeof targets === 'function')
|
|
|
|
{
|
|
|
|
targets = targets.call();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!Array.isArray(targets))
|
|
|
|
{
|
|
|
|
targets = [ targets ];
|
|
|
|
}
|
|
|
|
|
|
|
|
return targets;
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = GetTargets;
|