mirror of
https://github.com/photonstorm/phaser
synced 2024-11-22 04:33:31 +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,13 +1020,16 @@ var Animation = new Class({
|
|||
|
||||
gameObject.setSizeToFrame();
|
||||
|
||||
if (animationFrame.frame.customPivot)
|
||||
if (gameObject._originComponent)
|
||||
{
|
||||
gameObject.setOrigin(animationFrame.frame.pivotX, animationFrame.frame.pivotY);
|
||||
}
|
||||
else
|
||||
{
|
||||
gameObject.updateDisplayOrigin();
|
||||
if (animationFrame.frame.customPivot)
|
||||
{
|
||||
gameObject.setOrigin(animationFrame.frame.pivotX, animationFrame.frame.pivotY);
|
||||
}
|
||||
else
|
||||
{
|
||||
gameObject.updateDisplayOrigin();
|
||||
}
|
||||
}
|
||||
|
||||
return gameObject;
|
||||
|
|
Loading…
Reference in a new issue