mirror of
https://github.com/photonstorm/phaser
synced 2025-02-17 06:28:30 +00:00
Set directly on Sprite if a property, otherwise use setData. Fix #6391
This commit is contained in:
parent
881d62075f
commit
85d1673cce
1 changed files with 8 additions and 1 deletions
|
@ -219,7 +219,14 @@ var ObjectHelper = new Class({
|
|||
|
||||
for (var key in properties)
|
||||
{
|
||||
sprite.setData(key, properties[key]);
|
||||
if (sprite[key] !== undefined)
|
||||
{
|
||||
sprite[key] = properties[key];
|
||||
}
|
||||
else
|
||||
{
|
||||
sprite.setData(key, properties[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue