mirror of
https://github.com/photonstorm/phaser
synced 2024-11-26 06:30:38 +00:00
Animation.setCurrentFrame
will no longer try to call setOrigina
or updateDisplayOrigin
if the Game Object doesn't have the Origin component, preventing unknown function errors.
This commit is contained in:
parent
009dad281f
commit
4de9d52769
1 changed files with 9 additions and 6 deletions
|
@ -1020,6 +1020,8 @@ var Animation = new Class({
|
||||||
|
|
||||||
gameObject.setSizeToFrame();
|
gameObject.setSizeToFrame();
|
||||||
|
|
||||||
|
if (gameObject._originComponent)
|
||||||
|
{
|
||||||
if (animationFrame.frame.customPivot)
|
if (animationFrame.frame.customPivot)
|
||||||
{
|
{
|
||||||
gameObject.setOrigin(animationFrame.frame.pivotX, animationFrame.frame.pivotY);
|
gameObject.setOrigin(animationFrame.frame.pivotX, animationFrame.frame.pivotY);
|
||||||
|
@ -1028,6 +1030,7 @@ var Animation = new Class({
|
||||||
{
|
{
|
||||||
gameObject.updateDisplayOrigin();
|
gameObject.updateDisplayOrigin();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return gameObject;
|
return gameObject;
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue