mirror of
https://github.com/photonstorm/phaser
synced 2024-11-26 06:30:38 +00:00
Merge branch 'master' of https://github.com/photonstorm/phaser
This commit is contained in:
commit
d4b19cee5b
1 changed files with 25 additions and 6 deletions
|
@ -831,15 +831,34 @@ var Tilemap = new Class({
|
|||
}
|
||||
|
||||
// Set properties the class may have, or setData those it doesn't
|
||||
for (var key in obj.properties)
|
||||
if (Array.isArray(obj.properties))
|
||||
{
|
||||
if (sprite[key] !== undefined)
|
||||
// Tiled objects custom properties format
|
||||
obj.properties.forEach(function (propData)
|
||||
{
|
||||
sprite[key] = obj.properties[key];
|
||||
}
|
||||
else
|
||||
var key = propData['name'];
|
||||
if (sprite[key] !== undefined)
|
||||
{
|
||||
sprite[key] = propData['value'];
|
||||
}
|
||||
else
|
||||
{
|
||||
sprite.setData(key, propData['value']);
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
for (var key in obj.properties)
|
||||
{
|
||||
sprite.setData(key, obj.properties[key]);
|
||||
if (sprite[key] !== undefined)
|
||||
{
|
||||
sprite[key] = obj.properties[key];
|
||||
}
|
||||
else
|
||||
{
|
||||
sprite.setData(key, obj.properties[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue